三张表 downloadlogs_day : id,downloadtime时间,ipaddress网关地址,filename所下载的文件名称,downloadnumber一分钟内该网关下载的次数
ipaddressmappings : id,ipaddress网关地址,area网关所属地区,国家,省份
filesupportmobile: id,filename文件名称,mobiletype手机终端类型agent
我想联合这三张表查询 所有地区,按日分组的 下载次数
sql :
SELECT d.downloadtime ,'全部' as mobiletype,sum(d.downloadnumber) as number FROM downloadlogs_day as d ,filesupportmobile as f ,ipaddressmappings as i where f.filename = d.filename and d.ipaddress = i.ipaddress and d.downloadtime >= '2009-06-15' and d.downloadtime <= '2009-06-19'
group by d.downloadtime order by downloadtime
上面这条sql的查询结果一天一变化,就是昨天查到的结果和今天查到的结果不一样,请大家看看问题出在什么地方。谢谢