Re: Simple SQL query.... maybe
Hi,
Mysql also has a nice (non-standard SQL) feature that allows hidden fields in the GROUP BY statement..
http://dev.mysql.com/doc/mysql/en/group-by-hidden-fields.html
If this query returns zero results (ie, every col1-col2-col3 combination is unique)
select col1, col2, col3, count(*) from table group by 1,2,3 having count(*)>1;
...then the group by with hidden fields should work. Note, I'm only grouping by the first two columns below
select col1, col2, max(col3), col4, col5, col6, col7, col8, col9, col10 from table group by 1,2;
Otherwise you're stuck with a subquery or join and will get some multiple rows for each col1-col2-max(col3) records.
Chris