题解 | #网易云音乐推荐(网易校招笔试真题)#
网易云音乐推荐(网易校招笔试真题)
https://www.nowcoder.com/practice/048ed413ac0e4cf4a774b906fc87e0e7
select a.music_name from ( select distinct m.music_name music_name ,m.id from music m join music_likes ml on m.id=ml.music_id where ml.music_id in ( select ml0.music_id from music_likes ml0 where ml0.user_id in ( select f.follower_id from follow f where f.user_id = '1' ) ) and ml.music_id not in ( select ml0.music_id from music_likes ml0 where ml0.user_id = '1' ) order by 2 )a