题解 | 网易云音乐推荐(网易校招笔试真题)注意distinct和orderby的使用条件

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

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

select music_name
from (
    select distinct music_name, music_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 (f.user_id,music_id) not in (
    select f.user_id, ml.music_id
    from follow f join music_likes ml on f.user_id=ml.user_id
)
) as m1
order by music_id asc;

全部评论

相关推荐

KKorz:是这样的,还会定期默写抽查
点赞 评论 收藏
分享
03-01 19:30
已编辑
南京大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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