March 15, 2007 at 5:12 am
I want to display the whole table but with distinct value for the first column. When i'm doing this 'select distinct phone_number from temp_table' then it display only the first column. I want to display the whole three column but with the condition of distinct phone_number only.
could anyone help me out please........
March 15, 2007 at 5:21 am
not able to get your requirement. if there are 10 records in table, with 3 distinct phone_numbers, how your results should look ??
can you put an example of what you want ?
March 15, 2007 at 5:30 am
thnaks for reply....
I want to display the whole data, but with distinct first column.....
I mean only the first colmn is primary key irrespective of the others three columns. I want to display the whole data but with distinct first_column.......
suppose my entries are like :
911111111111, good, english
911111111111, bad, english
912222222222, good, english
913333333333, bad, hindi
911111111111, good, malayalam
912222222222, good, english
..................
when i write query it should display as :
911111111111,good,english
912222222222,good, english
913333333333, bad, hindi
i mean to say that of the result of distinct phone_number it should display with the other two columns......
i want to have the phone_number should be distinct irrespective of the other two column( wheather it's same or not , don't mind)........
please help me out .......
March 15, 2007 at 7:16 am
So may be you don't care about the values in next 2 columns. or their relation with the phone number column. you may want to revisit you table designs.
try this.
select phone, min (col1), min(col2)
from table
group by phone
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply