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

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

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

with fid as(select f.user_id,follower_id,music_id
from follow f left join music_likes m on f.follower_id=m.user_id
where f.user_id=1 and music_id not in (
    select music_id 
    from music_likes
    where user_id=1
))
select music_name
from fid join music on fid.music_id=music.id
group by music_name,music.id
order by music.id

在SQL查询中遇到“Expression #1 of ORDER BY clause is not in SELECT list, references column 'music.id' which is not in SELECT list; this is incompatible with DISTINCT”的错误时,这意味着你在使用DISTINCT关键字的同时,在ORDER BY子句中引用了未在SELECT列表中的列

全部评论

相关推荐

11-08 17:36
诺瓦科技_HR
点赞 评论 收藏
分享
微风不断:兄弟,你把四旋翼都做出来了那个挺难的吧
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务