Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ORDER BY with static fields
"Joseph Ranseth" <jranseth_at_worldNO_SPAMcupfishing.com> wrote in message
news:axfp5.1579$Io1.8259_at_news1.mts.net...
> I have a union query in which I am placing a static field to distinguish
> which table the data came from.
> When I have this field, it will not sort by another field - How can I get
> around this? (SQL included at bottom)
> ie:
> select a, b, 'tbl_a'
> from tbl_a
> union
> select a, b, 'tbl_b'
> from tbl_b
> order by b desc
Try ordering by the column's position?
select a, b, 'tbl_a'
from tbl_a
union
select a, b, 'tbl_b'
from tbl_b
order by 3
-Matt Received on Thu Aug 24 2000 - 20:48:11 CDT
![]() |
![]() |