I have a query like this:
(SELECT * FROM something WHERE ...) UNION (SELECT * FROM something WHERE ...)
Because I want the results from the first SELECT
to come out on top. But, the second part comes out in reverse order. I can't simply order the entire query because it will push the first SELECT
that I need at the top to the bottom... So I want to do something like this:
(SELECT * FROM something WHERE ...) UNION (SELECT * FROM something WHERE ... ORDER BY timestamp DESC)
But this just doesn't work, the ORDER BY
is completely ignored; I tested this by inserting gibberish, ORDER BY dosaif30h
still works... One solution would be to make two separate queries, but I'd much prefer to handle it in one.