Re: Left Join with more than two tables......

From: Date: Tue, 12 Aug 2003 20:00:05 +0000
Subject: Re: Left Join with more than two tables......
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-29857@lists.php.net to get a copy of this message
The left join works the same for two or more tables. select * from table1 left join table2 on table1.id=table2.id left join table3 on table1.id=table3.id ... Just specify the table you want to join and what to use to join them. On Tuesday, August 12, 2003, at 03:16 PM, Michael Cortes wrote:
I know that we can ...... select last_name,first_name, table2.school from table1 left join table2 on school_id=bldg_id Listing all students and giving the school name for all students, if they have one. If not, it lists the kid anyway and leaves that field blank. Anyhow, how about multiple tables? I can't find it with google. I have : table1 with the students table2 with library PINs and an autoincrement id table3 with a lunch status and an autoincrement id I want to list all students (I will select just certain fields) but if they have it, I want to list the PIN from table2 and the lunch status from table3. I can do it as a join but then anystudent who doesn't cross-reference gets left out. I need to list all students. -- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577


« previous php.db (#29857) next »