日期:2014-05-17  浏览次数:20805 次

写不出来,求救
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