Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different types of JOINs and performance

Status
Not open for further replies.

link9

Programmer
Nov 28, 2000
3,387
US
Hello all --

Just wanted to get some input on this. There are basically two different ways to construct a query that JOINs two tables together, and I was wondering if there's any performance difference between the two:

SELECT t1.*
FROM table1 t1 INNER JOIN table2 t2 ON t1.col1 = t2.col2

-- OR --

SELECT t1.*
FROM table1 t1, table2 t2
WHERE t1.col1 = t2.col2

Personally, I use the first option, but I have seen many examples using the second, and was just curious as to if there's any real difference.

Thanks! :)
paul
penny1.gif
penny1.gif
 
It's my understanding that regardless of how you write the query, it will be executed as :


SELECT t1.*
FROM table1 t1 INNER JOIN table2 t2 ON t1.col1 = t2.col2

so there is no difference in performance. This method is the recommended one.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top