Subject Re: [firebird-support] SELECT UNION with ORDER BY?!
Author Martijn Tonies
Hi,

> Isn't it possible to define SQL query similar to:
>
> SELECT T1.*,T2.A WHERE T2.ID=T1.ID
> UNION
> SELECT T1.*,T1.B WHERE T1.ID=-1
>
> ORDER BY 0 /or T1.C
>
> (Union works well, but when trying ORDER BY I get invalid ORDER BY
> clause error)
>
> What am I doing wrong?

ORDER BY <column ordinal, starting at 1>

With regards,

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