Subject | Re: [firebird-support] ODER BY após UNION o u UNION ALL |
---|---|
Author | Almond |
Post date | 2004-05-11T02:15:31Z |
>An union can be ordered by field number. The above can be rewrote to:
>Paulo,
>
>You should write in English on this list.
>
>Create a view with your select and union and then select from that view
>with an order by clause.
>
>create view vTest(ColumnA, ColumnB) as
>select
> ColumnA, Column B
>from
> TableA
>union all
>select
> ColumnA, Column B
>from
> TableB;
>
>select * from vTest order by ColumnA
create view vTest(ColumnA, ColumnB) as
select
ColumnA, Column B
from
TableA
union all
select
ColumnA, Column B
from
TableB
Order by 1, 2 or (or Order by 2, 1, etc)
^^^^^^^^^^^^^^
Hope this help.
Best regards,
Almond Wong