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 |
|
Rheinhardt
Yak Posting Veteran
66 Posts |
Posted - 2009-04-14 : 09:19:53
|
| Hi,How do I join more than one table setting the first tables Primary key column as the base ?Table1 join Tbale2 join Table3 join Table41 1 1 12 2 2 23 3 3 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2009-04-14 : 09:47:19
|
| use JOINs, If the data exist in both tables, you want INNER JOIN, if you want all data from the left table, but only those ont he right that existy in the left, then you want LEFT JOIN.Look up joins in BOL (Books Online) or here:http://msdn.microsoft.com/en-us/library/ms191517.aspx |
 |
|
|
Rajesh Jonnalagadda
Starting Member
45 Posts |
Posted - 2009-04-15 : 02:34:30
|
| HiThis is sample code and you can write as per your requirments,for more info follow the MSDN link given by RickDSELECT * FROM Table1 AJOIN Table2 BOn A.ID = B.IDJOIN Table3 C On B.ID = C.IDJOIN Table4 DOn C.ID = D.IDRajesh Jonnalagadda[url="http://www.ggktech.com"]GGK TECH[/url] |
 |
|
|
|
|
|