Subject Re: [firebird-support] SELECT UNION with ORDER BY?!
Author Tiberiu Horvath
These tricks are something that justifies my lurking on this mailinglist ...

Tiberiu
----- Original Message -----
From: Martijn Tonies
To: firebird-support@yahoogroups.com
Sent: Monday, April 11, 2005 6:16 PM
Subject: Re: [firebird-support] SELECT UNION with ORDER BY?!


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



---------------------------------
Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



---------------------------------
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.

[Non-text portions of this message have been removed]