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 |
nagiub2007
Starting Member
1 Post |
Posted - 2012-04-08 : 19:15:49
|
i have 3 tables (employee,structure,District)1_employee empid,workid fk to structid ,actuallwork fk to struct id 2_ structure structid , districtId fk to district 3_District districtid , districtname i want to get empid , work , actuallwork i want under work and actualwork district nameahmed naguib |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-04-09 : 00:33:42
|
use two separate joinsSELECT d1.districtname as work,d2.districtname as actualworkFROM employee einner join structure s1on s1.structid = e.workidinner join district d1on d1.districtid = s1.districtid inner join structure s2on s2.structid = e.actualworkinner join district d2on d2.districtid = s2.districtid ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|