I have this table:
A,B,C
2,5,6
2,8,5
3,4,7
3,4,8
I want to group the results by A, and select the max C value. The query for it is something like
SELECT A, MAX(C) FROM table GROUP BY A
My Question is, how can I retrieve the B value that is next to the max(c) value? Can this be done in the same quesry, or do I need a join query and look for the B field after running the first query?
Thanks!
try this:
FIDDLE DEMO