select
sum(decode(fbilltype,0,1,4,0,0)) 呼入来电数量, sum(decode(fbilltype,0,ftimelong,4,0,0)) 呼入来电时长,
sum(decode(fbilltype,4,1,0,0,0)) 呼出来电数量, sum(decode(fbilltype,4,ftimelong,0,0,0)) 呼出来电时长
from CCDBO.cc_bill201008
decode(fbilltype,0,1,4,0,0) decode一个函数 如果fbilltype值为0的话取1,如果fbilltype值为4的话取0 默认值取0
sum(decode(fbilltype,0,1,4,0,0)) 求他们的和