作业帮 > 综合 > 作业

mysql 查询 not in not like和in like啥区别啊

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/29 07:32:50
mysql 查询 not in not like和in like啥区别啊
select * from aaaa where id in(1,2,3);
select * from aaaa where id not in(1,2,3);
select * from aaaa where tt like "%as%";
select * from aaaa where tt not like "%as%";
1 3我懂 2 4这个加了not是什么意思啊
mysql 查询 not in not like和in like啥区别啊
加了not就是in的补集.
select * from aaaa where id in(1,2,3); --查找id在1,2,3中的数据集
select * from aaaa where id not in(1,2,3); --查找id不在1,2,3中的数据集
select * from aaaa where tt like "%as%"; --查找tt字段中包含as字符的数据集
select * from aaaa where tt not like "%as%"; --查找tt字段中不包含as字符的数据集