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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



-- 

Michael Cortes
Fort LeBoeuf School District
34 East Ninth Street
PO Box 810
Waterford PA 16441-0810
814.796.4795

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux