Subject Re: [firebird-support] Order by in Union
Author Martijn Tonies
>
> How do I specify an order by in a unioned query?
>
> Example:
>
> SELECT NAME
> FROM TABLE1
> UNION
> SELECT NAME
> FROM TABLE2
> ORDER BY NAME
>
> this doesn't appear to work.

By column ordinal -

ORDER BY 1

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com