0
我想进行自定义订单:IN,OUT,FINISHED。
如果我遗留了病例陈述,我正在完成FIN,IN,OUT。 我发现这个解决方案,但它不适合我 - 我得到错误。明确陈述后的自定义订单
select distinct 'IN' as STATUS,
(select count(*) ...)
from table
UNION ALL
select distinct 'OUT',
(select count(*) ...)
from table
UNION ALL
select distinct 'FINISHED',
(select count(*) ...)
from table
order by
case STATUS
when 'IN' then 1
when 'OUT' then 2
when 'FINISHED' then 3
end
您应该发布这样的问题的逐字错误消息。 –