mybatis sql 如何分组查询成功和失败统计次数
需求,成功状态为1,失败状态为0,现在统计18号的成订单多少次,失败订单多少次?select BRAND_ID,STORE_ID,sum(case when ORDER_STATUS = 1 then 1 else 1 end) as 成功,sum(case when ORDER_STATUS = 0 then 0 else 1 end) as 失败from t_loreal_prod...
原创
2020-01-19 15:13:42 ·
1587 阅读 ·
0 评论