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 |
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-27 : 05:25:58
|
| Dear Experts,I have problem in linking a table with two tables by join,I have these tables followed by their fields:1-Employee :e_no,e_name1,e_dept,e_job2-Dept :c_no,c_name3-Job :c_no,c_nameI would get this result select e.e_no,e.e_name,d.c_name,j.c_name from employee e , dept d , job jthis need to link twice , e.e_dept=d.c_no and e.e_job=j.c_noIf I use the the where clause it wont bring the employees withoutdept and job numbers in the main employee tableHow can use the join in this issueThanks In AdvanceTamer |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-27 : 05:31:41
|
use left joinselect e.e_no,e.e_name,d.c_name,j.c_name from employee e left join dept d on e.e_dept=d.c_noleft join job jon e.e_job=j.c_no |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-27 : 05:38:44
|
| Thank you very much Mr.It works fine |
 |
|
|
|
|
|
|
|