thanks zhu. i found a solution using your suggestion and the manual:
http://dev.mysql.com/doc/refman/5.0/en/union.html
(select 1 as one, brand, max(year) two from cars group by brand)
union
(select 2 as one, brand, year two from cars) order by one, two desc;
the important question now is perform
select brand, max(year) from cars group by year order by yearunion
select brand, year from cars order by year
2009/4/25 Olav Mørkrid
> Say I have a table with any number of car brands, with belonging street
> dates.
>
> Is it possible to do the following type of sort in a single query?
>
> 1. F
Say I have a table with any number of car brands, with belonging street dates.
Is it possible to do the following type of sort in a single query?
1. First I want the newest model of all car brands, but only one of
each brand! And they should be ordered by year
2. Then I want the cars that weren'