22,209
社区成员
发帖
与我相关
我的任务
分享
select date(orderTime) as '日期', count(*) as '总笔数',
成功笔数=sum(case when payStatus=1 then 1 else 0 end),
未支付笔数=sum(case when payStatus=0 then 1 else 0 end),
冲正笔数=sum(case when payStatus=3 then 1 else 0 end),
成功总金额=sum(case when payStatus=1 then amount else 0 end)*0.01,
from morder
where orderTime between '2011-05-10' and '2011-05-20'
GROUP by date(orderTime)