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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 how to join 4 tables

Author  Topic 

asifbhura
Posting Yak Master

165 Posts

Posted - 2010-09-25 : 06:55:15
Hello
I have 4 tables

table1, table2 , table3, table4

table1 contains filterno
Table2 contains filterno,courseno, offerno
Table3 contains Courseno,coursedetail,coursestatus
table4 contains offerno,offertype


where Filterno='2'
I want
filterno,courseno,coursedetail,offerno,offertype

please help me out

Regards,
ASIF

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-09-25 : 07:23:40
select ...
from table1 as t1
join table2 as t2 on t2.filterno = t1.filterno
join table3 as t3 on t3.courseno = t2.courseno
join table4 as t4 on t4.offerno = t2.offerno
where filterno='2'


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -