Sql统计某一字段中每种情况的数量 Access数据库
表字段如下:ID CheckId1 11 01 21 11 31 01 02 22 32 3统计结果要求如下:ID “0” “1” “2” “3”1 3 2 1 12 0 0 1 2
其他答案
select ID,sum(case CheckId when 0 then 1 else 0 end) as 1,sum(case CheckId when 1 then 1 else 0 end) as 2,sum(case CheckId when 2 then 1 else 0 end) as 3,sum(case CheckId when 3 then 1 else 0 end) as 展开
2010-12-17 16:57
来自北京市
赞(1)点赞赞(1)举报
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。




