Re: A Join Question
| From: | Hugh Bothwell | Date: | Mon, 30 Jul 2001 14:34:43 +0000 |
| Subject: | Re: A Join Question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10902@lists.php.net to get a copy of this message | ||
"Steve Fitzgerald" <sf@mnetsys.com> wrote in message
news:20010730141456.85883.qmail@pb1.pair.com...
> I'm trying to create a join statement that pulls out a CompanyName based
> on a given CompanyID that is tied to a specified ContactID.
>
> For example, if ContactID=1 then the corresponding CompanyName might be
> Smith, Inc. depending on what was entered.
SELECT
CompanyName
FROM
Company
INNER JOIN
Contacts
ON
Company.CompanyID = Contacts.CompanyID
WHERE
ContactID=$ContactID