【发布时间】:2011-02-22 17:11:53
【问题描述】:
这两者之间有性能差异吗?
select * from tableA INNER JOIN tableB ON tableA.type = ? AND tableB.ref = tableA.id
select * from tableA INNER JOIN tableB ON tableB.ref = tableA.id WHERE tableA.type = ?
【问题讨论】:
-
不太一样。在这种情况下,我使用 join 组合表,并且 where 语句是附加的。您所说的可能重复实际上是指在我没有做的地方做加入的工作。 @OMG