| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
Do two joins in a single query?Table structure as follows:
'people' table: id | name --------------- 1 | scott 2 | jim 3 | bob 'projects' table: project_name | developer | requestor ------------------------------------- project1 | 1 | 2 project2 | 1 | 3 So basically I want to join more than one value from the 'people' table into a query on the 'projects' table. I'd like to get something like this: result: project_name | developer | requestor ------------------------------------- project1 | scott | jim project2 | scott | bob Is this possible in one SQL statement? |
|
|||
|
In Oracle you could do this:
SELECT |
|
|||
|
For some reason you might prefer this:
SELECTConsider however the type of join you need (perhaps "left" one?). |
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| can i wrire a query which sum up more than 2 columns in a single table? | kajal | SQL - Questions and Answers | 3 | 07-15-2008 10:00 AM |
| How to use two joins in a single query? | Vaibhav Pingl | SQL - Questions and Answers | 1 | 11-29-2006 06:59 PM |