在线等,急哦。帮我看看。谢谢
请问下。select sum(TALKING_TIME) from R_SU_E_bak t where
start_time>to_date('2011-11-01 00:00:00','yyyy-MM-dd hh24:mi:ss') and start_time<to_date('2011-11-30 23:59:59','yyyy-MM-dd hh24:mi:ss') and
and TARGET='ACD4955' and TALKING_TIME<'30'这句话是查TALKING_TIME的通话时间之和,我怎么查通话量是多少?
------解决方案--------------------你的通话量是怎么个说法。
------解决方案--------------------那就不加sum 按照你要的栏位列出
------解决方案--------------------是这个和?
SQL code
select count(1) from R_SU_E_bak t where TALKING_TIME<'30'
------解决方案--------------------
对的。
count(1)和count(*)一样,是所有条数。
SQL code
select sum(TALKING_TIME) 总通话时间,COUNT(1) 总通话量 from R_SU_E_bak
where TARGET='ACD4955' and TALKING_TIME<'30' and
start_time>to_date('2011-11-01 00:00:00','yyyy-MM-dd hh24:mi:ss') and
start_time<to_date('2011-11-30 23:59:59','yyyy-MM-dd hh24:mi:ss')