赞
踩
使用not in关键字进行条件查询。
not in
select 字段1,字段2 from 表名 where 字段名 not in (元素1,元素2);
查询a表中id不等于1和2的数据:
a
id
1
2
select * from a where id not in (1,2);