使用mysql数据库,数据一个表大概在400万条左右,有id主键,将一部分select id from detail group by billno, iosort,barcode having count(*)>1 的数据写到表test的id字段,使用下列两个查询语句结果不一样,求问了领导,说是可能内存溢出,使用了left join或者 inner join正常
test表记录数在193万条左右,第一条sql查询出来的是193万条, 第二条查询出来的是93万条,不知道为什么不对,没找到原因,改为left join查询
select count(*) from test where id in (select id from detail )
select count(*) from detail where id in (select id from test)