What Does It Happen When Using Multiple Case ... When Statements In The Same Sql Query?
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 ELS
Solution 1:
First will come all records where user_id =34 with "active" status, then records with user_id=34 and status not "active", then records where user_id not equal 34 and status equals "active" , finally all remaining records where status is not "active"
Post a Comment for "What Does It Happen When Using Multiple Case ... When Statements In The Same Sql Query?"