Subject Re: [firebird-support] Re: union
Author Ann W. Harrison
danyschaer wrote:
>
> The way I see that works with Firebird an the others engines (Oracle, Postgres) is:
>
> select * from (select "FECH","HECH" from "MOVI" where "HECH"='P' order by "FECH") A1
> union
> select * from (select "FECH","HECH" from "MOVI" where "HECH"='P' order by "FECH") A2
>
> Also, I can see my other approach does not work in any of the 3 engines.
>
> I was curious ... nothing else.
>

The SQL standard calls the select in the union a query expression.
Order by is part of the select statement, not part of the query
expression. That part of the SQL Guru Full Employment policy.

Cheers,

Ann