题解 | #网易云音乐推荐(网易校招笔试真题)#

网易云音乐推荐(网易校招笔试真题)

http://www.nowcoder.com/practice/048ed413ac0e4cf4a774b906fc87e0e7

not in 方法

select distinct music_name
from follow f,music_likes ml,music m
where f.follower_id=ml.user_id
and ml.music_id=m.id
and f.user_id=1
and music_name not in (
    select music_name from music_likes,music
    where  user_id=1 and music_id=id
)
order by m.id;

not exists

select distinct m.music_name 
from follow f,music_likes ml,music m
where f.follower_id=ml.user_id    
and ml.music_id=m.id
and f.user_id=1
and not EXISTS
(
select * from music_likes ml,music m2
where  m2.id=m.id
and ml.music_id=m2.id
and ml.user_id=1
)
order by m.id


全部评论

相关推荐

不愿透露姓名的神秘牛友
昨天 16:22
主包是26应届生,投大厂简历一直过不了初筛,想问问大家有必要花钱改简历吗
Java抽象带篮子:我之前专门发个帖子说不要付费改简历的,里面还详细写了简历怎么写,你可以去看看
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务