select
    *
from
    (
        select
            month,
            row_number() over (
                partition by
                    month
                order by
                    play_pv desc,
                    song_id asc
            ) ranking,
            song_name,
            play_pv
        from
            (
                select
                    month (fdate) month,
                    p.song_id song_id,
                    song_name,
                    count(p.song_id) play_pv
                from
                    play_log p
                    join song_info s on p.song_id = s.song_id
                    join user_info u on p.user_id = u.user_id
                where
                    singer_name = "周杰伦"
                    and age >= 18
                    and age <= 25
                group by
                    1,
                    2,
                    3
            ) a
    ) b
where
    ranking < 4
order by
    month,
    ranking;