I've got a table like:
╔═══╦════════════════════╦═════════════╗
║ID ║ type (enum) ║ updated_at ║
╠═══╬════════════════════╬═════════════╣
║ 1 ║ friend_request ║ <date_time> ║
║ 2 ║ new_article ║ <date_time> ║
║ 3 ║ article_read ║ <date_time> ║
║ 4 ║ article_invitation ║ <date_time> ║
╚═══╩════════════════════╩═════════════╝
I would like to order the retrieved results by the value of the enum type.
Records with value friend_request and article_invitation for the type column should come first, then the rest. Everything together should be ordered by updated_at DESC.
Now, I know I can chain multiple order by properties, so f.e.
order by type desc, updated_at desc
will order for me by type and the result of that by the updated_at values. But how do I specify for certain values of the type column? Is that even possible?