Sample mysql table:
carnum,cartype,carname
1,sportscar,mustang
2,sportscar,mustang GT
3,sportscar,mustang GT
When I run this query:
SELECT carname, cartype
FROM cars
GROUP BY cartype
I get:
mustang,sportscar
What I want is:
mustang GT,sportscar
Is there a way to make the group use the most recent carname (mustang GT) rather than the first one (mustang)? I tried sorting in various ways but had no luck.
Thanks very much.