Re: join query/relational database question

From: Date: Mon, 06 Jan 2003 23:05:53 +0000
Subject: Re: join query/relational database question
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-24606@lists.php.net to get a copy of this message
At 04:09 PM 1/6/03 -0500, Doug Parker wrote:
I have a relational database issue that I'll simplify for the sake of this post. I have one table, called clients, that has an id and the company name. For example: id | company -----------------------
46      Jones Inc.
54      Baker Inc.
etc. I have another table called projects, that looks like this: id | company_id | status -----------------------------------------------
1       46                      Active
2       54                      Inactive
id | company_id | status        |       company
------------------------------------------------------------------------
1       46                      Active                  Jones Inc.
2       54                      Inactive                Baker Inc.
SELECT id, company.company_id, status, company FROM projects LEFT JOIN Companies USING( company_id ) ORDER BY company Rick

« previous php.db (#24606) next »