Skip to content
Advertisement

Query ORDER with UNION

I have to do punt an “*” in a list of dates, like this:

So, with my low knowledge, I created something like this code:

where “*” is present in the table Union. But, the command ORDER doesn’t work and I’ve a sort system just by number, like the follow:

How can avoid this? Thanks for the help

Advertisement

Answer

Thanks a lot to all, here some feedback:

select * from ( SubQuery1 UNION Subquery 2) ) as ANYname order by

This is working without “AS” and ORDER. If I put “AS name” and ORDER BY, the order will not work.

or

Both working only in ASC Mode not DESC. Anyway, thanks a lot to everybody.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement