- - Code, Content, and Presentation
- -- Databases
- ---- GROUP BY, returning the highest something per group?
httpwebwitch - 4:36 pm on Mar 8, 2011 (gmt 0)
now I've got this:
select * from table where number in (select max(number) from table group by letter)
it works - I've got the rows I want.
This seems kludgy to me. doing one select to get a list of ids, then another "IN" select to get the rows? it works, but isn't there a better way?
Thread source: http://www.webmasterworld.com/databases_sql_mysql/4278351.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com