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


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

Reply via email to