2
我想加入几个表,但要过滤来自'A'表的特定类型。哪个更好的查询来自以下两个查询(有没有更好的方法?)还是没有查询优化器的差异原因?SQL加入具有过滤条件的查询:性能
当过滤条件被在给定的“WHERE子句:
SELECT .. FROM A a JOIN B b ON a.id=b.id JOIN C c on a.id = c.id...<other joins>...WHERE a.col='SOME_VAL';
过滤条件被内给出“ON”:
SELECT .. FROM A a JOIN B b ON a.id=b.id AND a.col='SOME_VAL' JOIN C c on a.id = c.id...<other joins>