题解 | #Where in 和Not in#

Where in 和Not in

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

这题尝试了两种方法,最先想到的是使用IN:

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

然后又想到前面做过的利用OR的题目,觉着这个逻辑也是可以实现的,于是就有第二个答案:

select device_id,gender,age,university,gpa from user_profile where university='北京大学' or university='复旦大学' or university='山东大学';

全部评论

相关推荐

点赞 评论 收藏
分享
07-29 14:09
门头沟学院 Java
我爱o泡我爱o泡o泡果奶ooo
26加瓦鼠鼠:三个offer了,停手吧,回头是岸
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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