Subject | Re: [firebird-support] Re: SELECT UNION with ORDER BY?! |
---|---|
Author | Helen Borrie |
Post date | 2005-04-12T07:36:32Z |
At 05:32 AM 12/04/2005 +0000, you wrote:
the spec, regardless of what it is"...
The syntax would come to grief sooner than that point, if the two
corresponding output fields weren't type-compatible for forming the
union....but that's not the case here.
<pedant hat on>
Of course, whether using select * at all is good practice is another story.
</>
./hb
> > > SELECT T1.*,T2.A WHERE T2.ID=T1.IDAt 05:32 AM 12/04/2005 +0000, Graeme Edwards wrote:
> > > UNION
> > > SELECT T1.*,T1.B WHERE T1.ID=-1
> > >
> > > ORDER BY 0 /or T1.C
> > >
> wrong?
> >
> > ORDER BY <column ordinal, starting at 1>
> >
>In the example above using the union clause, I don't believe thatWhy not? Did you test it? It's only saying "order by the first field in
>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.
the spec, regardless of what it is"...
The syntax would come to grief sooner than that point, if the two
corresponding output fields weren't type-compatible for forming the
union....but that's not the case here.
<pedant hat on>
Of course, whether using select * at all is good practice is another story.
</>
./hb