Let's say I have a table w/ three rows: ID, Time, and Name. when I do:
 
select Time, Name group by Name Order By Time
 
MySQL selects one of the Time fields if there are rows with the same
Name and then does the ordering using this selected field (I am not sure
what is the logic but it seems it is the one that was inserted first in
the table). I would like to sort on the original Time field and not the
one selected by MySQL. For example, if:
 
ID    Time        Name
1      2             X
2       3            X
3       1            Y
 
I want to see:
 
3      X
1      Y
 
But I get:
 
2    X
1    Y
 
Any way to do this?
 
Thanks,
 
-JF

Reply via email to