题解 | #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='山东大学';

全部评论

相关推荐

05-12 17:28
已编辑
门头沟学院 硬件开发
ldf李鑫:不说公司名祝你以后天天遇到这样的公司
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务