I have a column called item_priority
Which has following values 'important', 'super_important', 'important_1', 'important_2'
I want to order the result in a way where the following items
'important', 'super_important', 'important_1', 'important_2'
Appear in order.
This is my query, it appears that important_2 appears before important_1, currently.
SELECT * from
main_table
where product_id = '200'
ORDER BY col1, col2, CASE WHEN item_priority ~ '^[a-zA-Z]' THEN 1 WHEN WHEN item_priority~ '^[0-9]' THEN 2 END, item_priority desc, col3