I have a query that returns among others a Record Status column. The record status column has several values like: “Active”, “Deleted”, etc …
I need to order the results by “Active”, then “Deleted”, then etc …
I am currently creating CTEs to bring each set of records then UNION ALL. Is there a better and dynamic way of getting the query done?
Thank you,
For more status values, you can do this: