从听歌流水中找到18-25岁用户在2022年每个月播放次数top 3的周杰伦的歌曲
区块链毕设网qklbishe.com为您提供问题的解答
从听歌流水中找到18-25岁用户在2022年每个月播放次数top 3的周杰伦的歌曲
with t as ( select month(fdate) as `month` ,row_number() over (partition by month(fdate) order by count(*) desc,song_id) as ranking ,song_name ,count(*) as play_pv from play_log join user_info using(user_id) join song_info using(song_id) where year(fdate) = '2022' and age between 18 and 25 and singer_name = '周杰伦' group by month(fdate),song_name,song_id #因为窗口函数中用到song_id排序。所以分组时要加上song_id ) select * from t where ranking <= 3
19:08
select * from ( select month(fdate)month ,row_number() over (partition by month(fdate)order by count(song_name)desc)ranking ,song_name ,count(song_name)play_pv from play_log p join song_info si on p.song_id = si.song_id join user_info ui on p.user_id = ui.user_id where age between 18 and 25 and singer_name = '周杰伦' and year(fdate)=2022 group by month,song_name)a where ranking <=3;
结果对的啊,到底是哪一步逻辑出错了,求指导
21:53
以上就是关于问题从听歌流水中找到18-25岁用户在2022年每个月播放次数top 3的周杰伦的歌曲的答案
欢迎关注区块链毕设网-
web3一级市场套利打新赚钱空投教程
区块链NFT链游项目方科学家脚本开发培训