-2
我想知道是否有人可以解釋哪些(如果有的話)這些查詢更有效率,還是他們會執行相同的?查詢效率 - 哪個性能更好?
任何洞察力是讚賞。
查詢#1:
select
col_1, col_2
from
tableA
join
(select
col_1, col_2
from
tableB
where
col_2 > X and col_2 < Y) subQueryB on tableA.col_1 = subQueryB.col_1
查詢#2:
select
col_1, col_2
from
tableA
join
tableB on tableA.col_1 = tableB.col_1
where
tableB.col_2 > X and tableB.col_2 < Y
查詢似乎不明確。哪個表的「col_1」和「col_2」正在返回? – hatchet
找出答案的最佳方式就是嘗試一下。 – hatchet