select phonedata.dnis,
sum(phonedata.timelen) as totaltimelen,
sum(phonedata.moneys) as totalmoneys,
sum(phonedata.realmoneys) as totalrealmoneys,
phone_path.company
FROM phonedata ,phone_path
where phonedata.dnis = phone_path.haoma
group by phonedata.dnis,phone_path.company 这样写不行么
sum(phonedata.timelen) as totaltimelen,
sum(phonedata.moneys) as totalmoneys,
sum(phonedata.realmoneys) as totalrealmoneys,
phone_path.company
FROM phonedata ,phone_path
where phonedata.dnis = phone_path.haoma
group by phonedata.dnis,phone_path.company 这样写不行么
有满足where条件 的记录么?
select phonedata.dnis, sum(phonedata.timelen) as totaltimelen, sum(phonedata.moneys) as totalmoneys, sum(phonedata.realmoneys) as totalrealmoneys, phone_path.company FROM phonedata LEFT OUT JOIN phone_path ON phonedata.dnis = phone_path.haoma where starttime>'2006-07-26 00:00:00' and starttime<'2006-07-26 23:59:59' and dnis like '96282%' and endtime is not null and dept is not null group by phonedata.dnis,phone_path.company order by totalrealmoneys desc 这句能查出数据,但就是那个company不显示