After my previous question, I have an SQL query like the following:
SELECT *
WHERE ...
ORDER BY
CASE user_id WHEN 34 THEN 1 ELSE 2 END,
CASE status WHEN 'active' THEN 1 ELSE 2 END
As you can see in the above code, there are two CASE ... WHEN
statements. What happens in this case? That is, how records will be ordered? May those "doubled" statements conflict?
UPDATE: I would like to make it to return records in this order: (1) records where user_id = 34
and status = 'active'
; (2) records where status = 'active'
(without user_id
conditions); (3) all other records. How can I make that?