I need to show a group of results first in a list and then show the rest of the results from the table below.
I've tried SQL: how to use UNION and order by a specific select? but it doesn't appear to work in my case.
My query looks like this
SELECT * FROM (
SELECT id, display as ordered
FROM table
WHERE id in (...) --these need to be first
UNION
SELECT id, display
FROM table
WHERE id not in (...) --these need to be at the end
)
ORDER BY ordered
My results are coming back all ordered by display regardless of what I do.
I'm using Oracle, btw.
Thanks for the help.