Skip navigation links

MySQL Forums :: MyISAM :: problem union and order by


Advanced Search

Re: problem union and order by
Posted by: Uwe Geercken ()
Date: April 13, 2012 01:36AM

ok. I found the trick that does it: instead of ordering the second query (which does ot work), I have added a field "ordinal" and then I order the whole result first by the ordinal and then the airline name.

(
select '[All]' as airline_name,0 as ordinal
)
union
(
select
distinct airline_name,1 as ordinal
from
staging_final
)
order by ordinal, airline_name

Options: ReplyQuote


Subject Views Written By Posted
problem union and order by 1303 Uwe Geercken 04/13/2012 01:07AM
Re: problem union and order by 816 Uwe Geercken 04/13/2012 01:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.