select * from (select month(fdate) as month,row_number()over(partition by month(fdate) order by count(song_id) desc) as ranking,song_name,count(song_id) as play_pv from play_log join user_info using(user_id) join song_info using(song_id) where fdate between '2022-01-01' and '2022-12-31' and age between 18 and 25 and singer_name = '周杰伦' group by month(fdate),song_id,song_name) as t1 where ranking <= 3

京公网安备 11010502036488号