select * from ( select fdate as month, row_number() over ( partition by fdate order by play_pv desc,song_id asc ) as ranking, song_name as song_name, play_pv from ( select month (p.fdate) as fdate, s.song_id, song_name, count(1) as play_pv from play_log p, song_info s, user_info u where p.song_id = ...