原始数据是 每人,每分钟,每个房间的观看数目标查出 每人每天的的最大数(计算所有房间每分钟的数,然后取最大的那分钟的数据当每日的峰值)。人 id 分钟timer 观看数num 房间 room_id有大神帮忙一起想想sql怎么写?
1 回答
慕慕森
TA贡献1856条经验 获得超17个赞
对的
select r.admin_id, max(t.sumMum), r.timer_count from ( select admin_id,timer_count,sum(num) As sumMum from room_running where timer_type = 'minute' and timer_count between 25532160 and 25533599 and ref_host = "" and room_id > 0 group by admin_id,timer_count ) t JOIN room_running r ON r.timer_type = t.timer_type group by admin_id
添加回答
举报
0/150
提交
取消