Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mohdmartin
Starting Member
22 Posts |
Posted - 2007-09-04 : 09:43:48
|
| How can user left outer join with three tables ?it retreive all employees name if position and department are not foundfields--------department_codeposition_codeposition_code and department_code include in employee tableSELECT e.name,e.position_codeFROM employee e LEFT OUTER JOIN position pON e.position_code = p.position_coderegardsMateen |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2007-09-04 : 10:00:40
|
| SELECT e.name,e.position_code, d.department_codeFROM employee e LEFT OUTER JOIN position pON e.position_code = p.position_codeLEFT OUTER JOIN department dON e.department_code = d.department_code |
 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2007-09-04 : 10:02:47
|
| Just add another left outer join statement:SELECT e.name,e.position_code,d.departmentFROM employee e LEFT OUTER JOIN position pON e.position_code = p.position_codeLEFT OUTER JOIN department dON <whatever links department to employee or position table>Jim |
 |
|
|
mohdmartin
Starting Member
22 Posts |
Posted - 2007-09-04 : 10:03:11
|
| Thanks you. |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-09-04 : 10:03:34
|
| Which is the third table?SELECT e.name,e.position_codeFROM employee e LEFT OUTER JOIN position pON e.position_code = p.position_codeLeft Join Dept d on e.DeptNo = d.DeptNoHarsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|