select
case status
when 'AR' then 1
when 'AV' then 2
when 'AN' then 3
when 'AD' then 4
when 'AC' then 5
when 'AY' then 6
when 'AH' then 7
else 8
end 'status_order', COUNT(*)
from dn_appeal_request
group by
case status
when 'AR' then 1
when 'AV' then 2
when 'AN' then 3
when 'AD' then 4
when 'AC' then 5
when 'AY' then 6
when 'AH' then 7
else 8
end
有沒有辦法通過在select中使用相同的case語句來做一個組?按問題分組
感謝的Mikael多行.. –