left joining more than 2 tables

madrav72

Registered User.
Local time
Today, 07:20
Joined
Dec 1, 2001
Messages
81
Hi whats the syntax for left joining more than 2 tables if each of the tables has a common column???
 
SELECT
FROM (Table1 LEFT JOIN Table2 ON Table1.column1 = Table2.column1) LEFT JOIN Table3 ON Table1.column1 = Table3.Column1;
 
madrav72,

A wee tip... create the query in design view.
You can double click the line that joins the 2 tables (to change the join properties). This allows you to create an inner join, right join or left join...

Once you have done this you can then click on SQL view to see the new syntax.

J.
 
Macca the Hacca i tried your syntax but it seems to have problems with it - it keeps point to eliminate the third table name from the sql code - syntax error in join operation
 
It is so much easier to just use the QBE when you don't know the specific syntax. Just add the three tables and draw the join lines by dragging from pk to foreign key. Double click on the middle of the join line to change the join type. Select the columns you want from each table and switch to SQL view at that point. Unless I'm copying and pasting, I always start with the QBE. Why would I ever type when all I need to do is click? I work with way too many databases (several clients, several databases, plus my own personal ones) to remember every table and column name in every database!
 

Users who are viewing this thread

Back
Top Bottom