急等! 一个数据库问题 我有一个表,里面有一列是'ZJ'代表着体检结果其值为不同病名称若无病则写"正常",现在想统计出所有体检人中,'ZJ'为'正常'的人数和患病人数(除了'正常'的都是).请问如何写SQL 语句. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select sum(case when zj=N'正常'' then 1 else 0 end),sum(case when zj=N'正常' then 0 else 1 end)from table select 正常=sum(case when ZJ='正常' then 1 else 0 end),患病人数=sum(case when ZJ<>'正常' then 1 else 0 end)from 表 有问题啊, 我用的是ACCESS 数据库, 查询的时候说的操作符丢失啊 select sum(case zj when '正常' then 1 else 0 end),count(*)- sum(case zj when '正常' then 1 else 0 end) from table sql语法错误 LIKE,NOT LIKE问题 存储过程中cast是什么意思? 还未解决再贴一次,解决了马上结分,再线等 求一条SQL查询语句 ~~~~~~~~~大侠,榜榜忙!!!求一SQL语句~~~~~~~~~ 查询的记录老是不随着参数变化的问题 sql 索引问题! 问一个问题,非常感谢 用delphi如何调用SQL Server存储过程? 高手指教! 求助, 碰到两道面试难题, 不知道有没有高人指点一下?
sum(case when zj=N'正常' then 0 else 1 end)
from table
患病人数=sum(case when ZJ<>'正常' then 1 else 0 end)
from 表