![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
This works fine as above but as soon as I reintroduce the ORDER BY clause I get the syntax error... ERROR: column "table_catalog" does not exist LINE 19: table_catalog, ^ ********** Error ********** ERROR: column "table_catalog" does not exist SQL state: 42703 Character: 667 From the documentation I infer that ORDER BY should work with UNION, so where am I going wrong? Any help please... |
#3
| |||
| |||
|
|
Try order by databaseName. Also, the order by clause applies to the whole query (your indentation indicates otherwise) |
#4
| |||
| |||
|
|
On Fri, 23 Jul 2010 06:11:33 +0200, Lennart Jonsson <erik.lennart.jonsson (AT) gmail (DOT) com> wrote: Try order by databaseName. Also, the order by clause applies to the whole query (your indentation indicates otherwise) Yes, that worked, thanks. From my old Oracle days I don't recall ORDER BY working on aliases, unless my memory is blurred. |
|
(BTW. the indentation was just for formatting to aid clarity in my question) |
#5
| |||
| |||
|
|
is a derived table so the only thing that's visible in the order by clause is the renamed attributes |
![]() |
| Thread Tools | |
| Display Modes | |
| |