求教一个查询问题 我有一张表(此处忽略主键)type work1 false2 true2 true3 false3 false我如何才能得出每种type false的个数呢。比如以上例子得到的答案是count type1 10 22 3 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select sum(case work when 'false' then 1 else 0 end) as [count],type from tablename group by type select type,[count]=sum(case when work='false' then 1 else 0 end)from tb group by type select sum(case work when 'false' then 1 else 0 end) as [count], [type] from tbgroup by [type] sql 2008 触发器 Deleted,inserted 无效。 如何查询每个表实际占用多大的磁盘空间 求一条SQL命令,或者帮我优化一下我的语句。从库中读出所有人员的第一条记录有效记录。 改为“本地链接和远程链接”后,重启服务报错 asp.net连接SQL SERVER出现问题了 查询语句分组统计 vfp的查询问题? 英雄啊,如何在sql存储过程中调用vb中定义的变量??? 表中某一列全是汉字,(access或sqlserver或oracle里)怎样实现按其拼音排序?怎样获得其拼音? SQL server2008镜像问题 下载了一个BBS网站源码,无法登录数据库 求exists 用法详解
sum(case work when 'false' then 1 else 0 end) as [count],
type
from tablename group by type
from tb group by type
sum(case work when 'false' then 1 else 0 end) as [count],
[type]
from
tb
group by
[type]