NOT IN 无效

select * from A where id not in (一堆具体的值);

我遇到的情况是查询出A表的所有内容,not in 没有效果


解决方案:

我的做法是将not in 后面的值存到一张临时表B中,

select * from A where id not in (select id from B)

猜你喜欢

转载自blog.csdn.net/weixin_41830501/article/details/80816938