Subject Re: [firebird-support] Re: Unexpected behaviour when using union
Author Dmitry Kuzmenko
Hello, roydamman!

r> Maybe I am wrong but I always thought the "order by" is applied on
r> the results of the two selects in both the second and third union query. And the order
r> by clause does work in the second query (also an union query)
r> "order by 2" and does not work in the third query "order by upper(2)". The only difference
r> is the use of "upper()" which does work with the first query with only one select.

I never heard about using upper(n) where n is the number of column. It
may work, but, anyway, union eliminates duplicate rows, while union all - not.
So, your thoughts are wrong. :-)

--
Dmitry Kuzmenko, www.ib-aid.com