Forum Moderators: coopster

Message Too Old, No Replies

Which approach is more efficient in MySQL

Where or Join

         

Learning Curve

6:36 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



I'm setting up my first PHP programs. Please forgive if this question is trite or has be answered many times.

I believe (hope) these two approaches produce the same results, joining the 4 tables.

Is either more efficient?

Approach #1

FROM table1, table2, table3
LEFT JOIN table4 ON table4.WebID = table3.WebID
WHERE table1.ID = table2.ID
AND table2.CityID = table3.CityID

Approach #2

FROM table1
INNER JOIN table2 ON table1.ID = table2.ID
INNER JOIN table3 ON table2.CityID = table3.CityID
LEFT JOIN table4 ON table4.WebID = table3.WebID

killroy

8:53 pm on Jul 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes, INNER JOIN is the defailt join and is used if no join is given.

SN