Subject Re: [ib-support] Union All with Order By
Author Paul Beach
> Is there any way to use a "Order By" with a query like this?
>
> select * from ks where city='COUNCIL GROVE'
> UNION ALL
> SELECT * from MO where city='RAYTOWN'

With Unions you order by the field no and not the field name, so on a....

select field1, field2 from a
UNION
select field 1, field2 from b
order by 2, 1

Regards
Paul Beach
Main Tel (UK):+44 (0) 1844 354465
Mobile: (UK): +44 (0) 7764 188603
http://www.ibphoenix.com
For all your upto date Firebird and
InterBase information