我有一个存储过程,它产生如下输出:
Success Fail Progress
----------------------------
1 2 3
但我希望输出为:
Recieved Count
----------------
success 1
----------------
fail 2
----------------
progress 3
请有人可以帮我从我的 sql 服务器获取此输出。
当前的 SQL:
select
sum(case when status='AK' then 1 else 0 end) as 'SUCCESS',
sum(case when status='E' then 1 else 0 end) as 'FAILURE',
sum(case when status NOT IN('AK','E')then 1 else 0 end) as 'PENDING'
from t
where [rec_datetime] BETWEEN '2008-02-11' AND DATEADD(DAY,1,'2008-02-11')