题解 | #Where in 和Not in#

Where in 和Not in

https://www.nowcoder.com/practice/0355033fc2244cdaa09b2bd6e794c762

以下两个都可:

select device_id,gender,age,university,gpa from user_profile where university IN ("北京大学","复旦大学","山东大学");

select device_id,gender,age,university,gpa from user_profile where university NOT IN ("浙江大学");

最开始是用了where university="北京大学" AND university="复旦大学" AND university="山东大学"

会报错,所以是因为AND连接的条件不能是同一字段的?同一字段的多个要求就需要用到where 字段 IN("")或者where 字段 NOT IN("")?

全部评论

相关推荐

03-31 21:47
东南大学 C++
彭于晏前来求offe...:吓晕了
点赞 评论 收藏
分享
zzzilik:没事的,才刚刚开始,后面会捞的,这个三天没人发起面试自动结束,但是面试官还是能看到简历,四月份主战场会慢慢捞
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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