Subject | Re: SELECT UNION with ORDER BY?! |
---|---|
Author | graeme_edwards2000 |
Post date | 2005-04-12T05:32:09Z |
--- In firebird-support@yahoogroups.com, Tiberiu Horvath
<tiberiu_horvath@y...> wrote:
you can order by an ordinal field number when using the t1.* syntax.
You may have to explicitly name the fields in order to do this.
Correct me if I am wrong.
Graeme Edwards
<tiberiu_horvath@y...> wrote:
> These tricks are something that justifies my lurking on thismailinglist ...
>ORDER BY
> 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
> > clause error)MySQL & MS SQL
> >
> > What am I doing wrong?
>
> ORDER BY <column ordinal, starting at 1>
>
> With regards,
>
> Martijn Tonies
> Database Workbench - developer tool for InterBase, Firebird,
> ServerIn the example above using the union clause, I don't believe that
> Upscene Productions
> http://www.upscene.com
>
you can order by an ordinal field number when using the t1.* syntax.
You may have to explicitly name the fields in order to do this.
Correct me if I am wrong.
Graeme Edwards
>Service.
>
> ---------------------------------
> 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
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
>
> [Non-text portions of this message have been removed]