I'm new to Redshift and looking for a way to specify the order I want the results in, the accepted answer here is exactly what I want, but the FIELD function does not exist in Redshift. Is there a way to accomplish the same result in Redshift?
Current Query looks like this:
SELECT DISTINCT audit_type, audit_category FROM "schema"."table"
ORDER BY audit_type,
CASE WHEN audit_category = 'string_1' THEN 1
WHEN audit_category = 'string_2' THEN 2
WHEN audit_category = 'string_3' THEN 3
WHEN audit_category = 'string_4' THEN 4
WHEN audit_category = 'string_5' THEN 5
WHEN audit_category = 'string_6' THEN 6
WHEN audit_category = 'string_7' THEN 7
ELSE 8 END