mahmood
Apr 8th 2006, 8:29 pm
I am trying to select 2 columns of a table, one of the distinct.
At the moment I have this code working:
SELECT DISTINCT `Town` FROM myTable
Say it returns 10 result, now I want the ID columns with these results too.
If I code:
SELECT DISTINCT `Town`,`ID` FROM myTable
It'll return far more result than I expect. I need only the same ten results but including ID.
Any idea?
At the moment I have this code working:
SELECT DISTINCT `Town` FROM myTable
Say it returns 10 result, now I want the ID columns with these results too.
If I code:
SELECT DISTINCT `Town`,`ID` FROM myTable
It'll return far more result than I expect. I need only the same ten results but including ID.
Any idea?