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是什

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/01 23:02:30

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啥区别啊
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啥区别啊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是什
加了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字符的数据集