I have an audit table that has data for insert, update, and delete operations. I am writing a report that will display data in insert, update and delete order. I don’t think order suggestion will help. any help?
You can use ORDER BY in combination with the CASE clause :
SELECT * FROM auditlog ORDER BY CASE operation_type WHEN 'Insert' THEN 1 WHEN 'Update' THEN 2 WHEN 'Delete' THEN 3 END