Copy link to clipboard
Copied
Hello, all,
Despite my derision for this "new platform", I don't have a choice if I need support, so here goes.
Using pseudo-code, I've got a query like:
SELECT col1 col1, col2 col2, col3 col3, col4 col4
FROM tableA
ORDER BY col4 DESC
UNION
SELECT col5 col1, col6 col2, col7 col3, col8 col4
FROM tableB
ORDER BY col4 DESC
And I'm getting the error message that the query isn't properly ended. I've tried with semi-colon, without semi-colon, can't seem to see why this errors in CF, but it works fine in SQL Developer. (Oracle db). Any ideas?
V/r,
^ _ ^
Copy link to clipboard
Copied
You should remove the first order by statmenet. The second one will cover both of them.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
What about using brackets, like this:
(select bla, bla, bla)
union
(select bla, bla, bla)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied