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;






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论