题解 | #网易云音乐推荐(网易校招笔试真题)#
网易云音乐推荐(网易校招笔试真题)
http://www.nowcoder.com/practice/048ed413ac0e4cf4a774b906fc87e0e7
SELECT DISTINCT music_name
FROM
(SELECT * FROM music_likes
WHERE user_id IN(
SELECT follower_iD FROM follow
WHERE user_id = 1)
AND music_id NOT IN (SELECT music_id FROM music_likes WHERE user_id = 1)) t1
LEFT OUTER JOIN music m
ON t1.music_id = m.id
ORDER BY t1.music_id