题解 | #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("")?
SHEIN希音公司福利 350人发布