热线电话:13121318867

登录
2019-02-27 阅读量: 807
SQL查询

问题描述:

290 成功的次数 6 是失败的次数
怎样一个sql 查出来 并且按 sid 和 api分组,要求 不用UNION,不连表

解决方法:

select sid,api,
sum(case when flag=0 then count else 0 end) count1,
sum(case when flag=1 then count else 0 end) count2
from table
group by sid,api;
18.8799
4
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子