List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:June 7 1999 8:15pm
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
> roger@stripped
> MetaLab. Yeh its fun.
> (919) 962-5646
> ---------------------------------------------------------------------

Try printing the query or looking in your MySQL log to see what query is
actually executed.

-- 
Sasha Pachev
http://www.sashanet.com/ (home)
http://www.direct1.com/ (work)
Thread
Joining tablesRoger Smith7 Jun
  • Re: Joining tablesSasha Pachev8 Jun
    • MySQL vs DB2Richard McLean12 Jun
      • Re: MySQL vs DB2Tani Hosokawa12 Jun
        • Re: MySQL vs DB2Richard McLean12 Jun
          • Re: MySQL vs DB2Tani Hosokawa12 Jun
            • Re: MySQL vs DB2Michael Widenius12 Jun
              • Re: MySQL vs DB2Luuk de Boer15 Jun
        • Re: MySQL vs DB2Michael Widenius12 Jun
          • Re: MySQL vs DB2Tani Hosokawa12 Jun
            • Comment on "MySQL == not transaction-based" (was: Re: MySQL vs DB2)Jason Haar16 Jun
              • Re: Comment on "MySQL == not transaction-based" (was: Re: MySQL vs DB2)Sasha Pachev16 Jun
  • Re: Joining tablesChristian Mack8 Jun