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

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

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


全部评论

相关推荐

10-17 13:54
上海大学 运营
雾凇岛:这还说什么了,冲了兄弟们
点赞 评论 收藏
分享
我的offer呢😡:这不才9月吗,26到明年毕业前能一直找啊,能拿下提前批,转正的,offer打牌的都是有两把刷子的,为什么非要跟他们比。如果别人是9本硕+金牌+好几段大厂实习呢?如果别人是双非通天代呢?如果别人是速通哥呢?,做好自己就行了,我们做不到他们一样提前杀死比赛,但晚点到终点也没啥关系吧
双非应该如何逆袭?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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