我與排序由flag_color
查詢工作,但顏色我希望它的優先級:如何按類型排序 - SQL
此查詢現在返回:
SELECT flag_color as color
FROM clinic_performance_flags
GROUP BY clinic_user_id
ORDER BY flag_color ASC
green
green
green
green
red
red
red
red
yellow
yellow
yellow
但是我想改變順序,所以順序變成(red
應該永遠是第一個,yellow
秒和第三個)示例:
red
red
red
red
yellow
yellow
yellow
yellow
green
green
green
green