select * from cdr where TimeLen > 0 and ValidTimeLen >0 and start_time> '2017-10-01 0:00:00' and start_time< '2017-10-31 23:00:00'
and TIMESTAMPDIFF(SECOND,start_time,end_time) > 5
/* 自动过滤掉Aleg的信息; 默认情况下Aleg和Bleg都保存了 */
select SUM(CEILING(ValidTimeLen/6)*0.008) from cdr where TimeLen > 0 and ValidTimeLen >0 and start_time> '2017-10-01 0:00:00' and start_time< '2017-10-31 23:00:00' and TIMESTAMPDIFF(SECOND,start_time,end_time) > 5;
select SUM(CEILING(ValidTimeLen/6)*0.008) from cdr where TimeLen > 0 and ValidTimeLen >0 and start_time> '2017-11-01 0:00:00' and start_time< '2017-11-30 23:00:00' and TIMESTAMPDIFF(SECOND,start_time,end_time) > 5;