I have a table of projects with several columns for the IDs of some people in various roles, and then a table of the people. How can I get all the people for a given project, but keep their roles straight?

Projects
----------
Project_ID
Boss_ID
Admin_ID
Assistant_ID

People
--------
ID
Name

Can I do something like this:

SELECT
* from Projects where Project_ID = 5,
Name from People where Projects.Boss_ID = People.ID as Boss_Name,
Name from People where Projects.Admin_ID = People.ID as Admin_Name,
Name from People where Projects.Assistant_ID = People.ID as Assistant_Name

I know that syntax isn't right but I'm not sure where to go.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to