当前位置: 代码迷 >> Sql Server >> 写不出来
  详细解决方案

写不出来

热度:70   发布时间:2016-04-27 11:11:18.0
写不出来,求救
A 表结构
id tzcode isonline addr 
1 20111026 True 成都市
2 20111027 Flase 北京
3 20111028 True 大连
....


我现在想要统计A 的所有数据,和isonline为True 的数据。
统计效果要在一列中
eg:
AcountNum isonlineNum
3 2

求一句SQL .

------解决方案--------------------
SQL code
select count(*),sum(case when isonline='true' then 1 end) from A
  相关解决方案