| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Christian Mack | Date: | June 8 1999 11:13am |
| Subject: | Re: Joining tables | ||
| View as plain text | |||
Roger Smith wrote: > > Hey all, I have a db with many tables and each table has this field > "machine_id" as a field. I have the following statement: > > $query = "SELECT * FROM birth,physical,deployment > WHERE( ($machine_id = birth.machine_id) OR > ($machine_id=physical.machine_id) OR ($machine_id = > deployment.machine_id))"; > and this doesn't return any information if the birth table had information > in it but the physical table doesn't and the deployment table doesn't. > Can you tell me what I am doing wrong and how I may correct it, thanks. > > Roger R. Smith Hi Roger You must have at least one row in each of the tables to get out something, or you have to use LEFT JOIN instead. Tschau Christian
| Thread | ||
|---|---|---|
| • Joining tables | Roger Smith | 7 Jun |
| • Re: Joining tables | Sasha Pachev | 8 Jun |
| • MySQL vs DB2 | Richard McLean | 12 Jun |
| • Re: MySQL vs DB2 | Tani Hosokawa | 12 Jun |
| • Re: MySQL vs DB2 | Richard McLean | 12 Jun |
| • Re: MySQL vs DB2 | Tani Hosokawa | 12 Jun |
| • Re: MySQL vs DB2 | Michael Widenius | 12 Jun |
| • Re: MySQL vs DB2 | Luuk de Boer | 15 Jun |
| • Re: MySQL vs DB2 | Michael Widenius | 12 Jun |
| • Re: MySQL vs DB2 | Tani Hosokawa | 12 Jun |
| • Comment on "MySQL == not transaction-based" (was: Re: MySQL vs DB2) | Jason Haar | 16 Jun |
| • Re: Comment on "MySQL == not transaction-based" (was: Re: MySQL vs DB2) | Sasha Pachev | 16 Jun |
| • Re: Joining tables | Christian Mack | 8 Jun |
