函数“in”常用使用方法

 

 

--查询地址不在上海市,江苏市,北京市的学生数据
select * from student where areaname not in('上海市','江苏市','北京市')

 

-- 在嵌套查询语句中的使用
SELECT u.id FROM user u WHERE u.ID not in (SELECT projectid FROM BASE_LOCATION where projectid is not null)
posted @ 2020-08-11 10:53  万里哥  阅读(1127)  评论(0编辑  收藏  举报