httpwebwitch - 3:39 pm on Mar 8, 2011 (gmt 0)
maybe I would solve this easier once I've had more coffee, but right now I'm not getting it. help!
number | letter | word
1 | a | one
2 | a | two
3 | a | three
4 | b | four
5 | b | five
SELECT letter, number, word FROM table GROUP BY letter
what it returns is:
a 1 one
b 4 four
What I need is to get the maximum, or highest number in each letter group. Not the lowest.
a 3 three
b 5 five
ORDER BY is merely ordering the results after grouping.
Is there a way to do this in one simple query?