select * from(
select month(a.fdate) as month,
row_number() over(partition by month(a.fdate) order by count(b.song_name) desc,b.song_id asc ) as ranking,
b.song_name,count(b.song_name) play_pv
from play_log a, song_info b, user_info c
where a.user_id=c.user_id and a.song_id=b.song_id and 
c.age between 18 and 25 and b.singer_name='周杰伦' and year(a.fdate)=2022
group by month,b.song_name,b.song_id
)d
where ranking<4