Joining tables is not a big deal. Try the given example below:
Example : Suppose you are having 4 tables(Table1, Table2, Table3, Table4).
ID EmployeeID
1 S001
2 S002
ID Name
1 Amit
2 Amy
ID Address
1 Bangalore
2 Gaya
ID PhoneNo
1 0123456789
2 9876543210
Now, if you want to join these three tables for data of corresponding ID, you can try this sql:
SELECT A.EmployeeID, B.Name, C.Address, D.PhoneNo
FROM Table1 A INNER JOIN Table2 B on A.ID = B.ID
INNER JOIN Table3 C on A.ID = C.ID
INNER JOIN Table4 D on A.ID = D.ID
WHERE A.ID = 101
Refer the links below for more details:
MSDN : Joining Three or More Tables[
^]
SQL Server 2008 - How to Join 3 tables[
^]
--Amit