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