查询运行时间超过10分钟。MySQL,使用“NOT IN(SELECT ...)”进行查询的速度很慢
SELECT *
FROM tableA
WHERE name NOT IN(
SELECT a.name
FROM tableA a
INNER JOIN tableB b ON a.code = b.code
INNER JOIN tableC c ON c.number = b.number
INNER JOIN tableD d ON d.code = b.code
INNER JOIN tableE e ON e.content= d.content)
是否有替代查询运行更快或有任何解决方案?非常感谢。
因为表B中没有列“名称”,所以我只使用t1.code = b.code,而且效果很好。无论如何,非常感谢你 – Nina
但这将是逻辑 – maSTAShuFu