Reputation: 55
basically I want this:
SELECT column FROM Table Where column LIKE "%interesting%"
UNION
SELECT column FROM Table
ORDER BY "the interesting results first, the fillers second."
I do this in case the interesting results are few, so that I fill them with random ones.
Upvotes: 0
Views: 31
Reputation: 1269563
You simply want an ORDER BY
:
SELECT column
FROM Table
ORDER BY (CASE WHEN column LIKE '%interesting%' THEN 1 ELSE 2 END);
Upvotes: 3