题解 | #网易云音乐推荐(网易校招笔试真题)#
网易云音乐推荐(网易校招笔试真题)
https://www.nowcoder.com/practice/048ed413ac0e4cf4a774b906fc87e0e7
with follow_music as ( select t1.user_id,t1.follower_id,t2.music_id from follow t1 left join music_likes t2 on t1.follower_id = t2.user_id where t1.user_id = 1 ) , remove_same_music as ( select music_id from follow_music where music_id not in ( select music_id from music_likes where user_id = 1 ) ) select p2.music_name from remove_same_music p1 left join music p2 on p1.music_id = p2.id group by p1.music_id order by p1.music_id