[eluser]chefnelone[/eluser]
[quote author="mddd" date="1279134614"]When using GROUP BY, you order the results that you get after GROUP BY. There is no way to influence which row you get inside each group; it is simply the first row (or if you have a WHERE clause, the first row to match the WHERE conditions).
However, you could do the sorting first in a subquery. And then group the results in the main query.
Code:
SELECT * FROM (SELECT * FROM table ORDER BY order) AS my_subquery GROUP BY group ORDER BY group
Basically, you are now doing the same query, only you are using a sorted table as the starting point, in stead of the table as it exists in the database.[/quote]
it's clear.
thanks