版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
后面接子查询的时候:
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')