W
Warrio
Hello!
Can you tell me which one of these queries is the best to get the quickest
result?
Q1= "SELECT * FROM Table1 INNER JOIN Table2 ON Table1.Field1=Table2.Field1
WHERE Table2.Field2 ='hello' "
Q2= "SELECT * FROM Table1 INNER JOIN (SELECT Table2.* FROM Table2 WHERE
Table2.Field2='hello') AS Table2 ON Table1.Field1=Table2.Field1
The only syntax diffrence in Q2 is that the WHERE clause is first excectued
on the Table2 and then the result is joined to Table1. Whereas Q1 links
first the two tables and then excutes the filter on the result.
Can you tell me which one of these queries is the best to get the quickest
result?
Q1= "SELECT * FROM Table1 INNER JOIN Table2 ON Table1.Field1=Table2.Field1
WHERE Table2.Field2 ='hello' "
Q2= "SELECT * FROM Table1 INNER JOIN (SELECT Table2.* FROM Table2 WHERE
Table2.Field2='hello') AS Table2 ON Table1.Field1=Table2.Field1
The only syntax diffrence in Q2 is that the WHERE clause is first excectued
on the Table2 and then the result is joined to Table1. Whereas Q1 links
first the two tables and then excutes the filter on the result.