Thread: JOINs?
View Single Post
Old 12-15-2007, 06:11 PM   #4 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Just remember to join on indexes. Don't join on non-indexes as it will become painfully slow.

LEFT JOIN basically says if the data is in table 1, but might not be in table 2 - if it's not in table 2, add a null and still pull table 1's data.

RIGHT JOIN is the reverse of the aforementioned.

INNER JOIN is when you only want to pull data from table 1 and table 2 when there's a valid JOIN on an index.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote