Mysql 对比两张表数据

xiaoxiao2021-02-28  27

查看一个表中的数据是否在另一个表中存在

第一种方案: select * from tb_a A where NOT EXISTS (select 1 from tb_b B where A.ID = B.ID); 第二种方案: select * from tb_a A where A.ID NOT IN(select B.ID from tb_b B );
转载请注明原文地址: https://www.6miu.com/read-2624457.html

最新回复(0)