这个SQL语句怎么写 select a,sum(case when b=1 then 1 else 0 end) [1],sum(case when b=2 then 1 else 0 end) [2] from T group by a 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select a,sum(case when b=1 then 1 else 0 end) ,sum(case when b=2 then 1 else 0 end) from T group by a select a ,sum(case when b=1 then 1 else 0 end) [1] ,sum(case when b=2 then 1 else 0 end) [2]from T group by a 求高手解答!sql server加密问题! 统计每个栏目的文章总数 网站数据库的注册有什么用呀? 如何验证数据库中角色、用户名、登录名已存在? 数据查询问题 这样的要求用SQL语句如何写? 问如何统计某条记录中为同一个值的字段数 大哥大姐!有关.SQL文件的生成 大家帮帮我吧 請教distinct select 問題 (简单)查询两张表之间差异的sql语句! 一个简单的sql语句,查询时间范围 如何连接远程SQL数据库
,sum(case when b=1 then 1 else 0 end) [1]
,sum(case when b=2 then 1 else 0 end) [2]
from T group by a