こんにちは私は動作しているDB2のSQLステートメントを持っています。
select distinct 'IN' as STATUS,
(select count(*) from table.......)
from table
UNION ALL
select distinct 'OUT',
(select count(*) from table.......)
from table
UNION ALL
select distinct 'FINISHED',
(select count(*) from table.......)
from table
order by status
しかし、最後の行をに変更すると
order by
case STATUS
when 'IN' then 1
when 'OUT' then 2
when 'FINISHED' then 3
end
クエリが機能しません。誰かがこれを解決する方法を教えてもらえますか?ありがとう