SQL语句的in 和 =,not in 和 !=,not in

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/baidu_41690072/article/details/79296880

后面接子查询的时候:

not in和in后面接的子查询的结果是一组集合

!=和=后面接的子查询的结果是一个值

not in是说明前面的不包含在后面子查询的集合里

//查询id是1的数据
select * from table_name where id = '1'
//查询id是1,2,3点数据
select * from table_name where id in ('1','2','3')

猜你喜欢

转载自blog.csdn.net/baidu_41690072/article/details/79296880