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 |
neellotus
Starting Member
15 Posts |
Posted - 2013-02-20 : 09:48:41
|
Hi All,I have fine tables table1,table2,table3,table4 & table5 and column "code" is contain all tables.Now i want to create inner join between first three 1, 2 & 3 table.Then i want inner join between two 4 & 5 table and then i want to create left outer join with first three tables on last two tables.Pls tell me how to write sql query i will be very thankful to you.ThanxNeel |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-20 : 10:09:20
|
[code]select columnsfrom table1 t1join table2 t2on t2.code = t1.codejoin table3 t3on t3.code = t2.codeleft join (select t4.code,.. other columns here from table4 t4 join table5 t5 on t5.code = t4.code )ton t.code = t1.code[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|