首页 > 代码库 > mysql in 和 not in 语句用法

mysql in 和 not in 语句用法

1.mysql in语句

select * from tb_name where id in (10,12,15,16);
2.mysql not in 语句

select * from tb_name where not id in (21,22,23);
3.mysql in not in 一起使用

select * from tb_name where id in (10,12,15,16) and not id in (21,22,23);

mysql in 和 not in 语句用法