SELECT
Count(WorkID) as countcall,
Sum(case when CallConnectTime=0 then 0 else 1 end) as countresponse,
Sum(case when FlagTransfer=0 then 0 else 1 end) as countflag
FROM
s20_cdrDetails_2010_12
这样的sql语句一次统计出来多个统计结果,尤其在分组统计需要对某个统计结果排序的时候
SELECT
Count(WorkID) as countcall,
Sum(case when CallConnectTime=0 then 0 else 1 end) as countresponse,
Sum(case when FlagTransfer=0 then 0 else 1 end) as countflag
FROM
s20_cdrDetails_2010_12
这样的sql语句一次统计出来多个统计结果,尤其在分组统计需要对某个统计结果排序的时候