Syntax :
Select table1.Column_Name1,table1.Column_Name2
from Table1 as a
Inner Join Table2 as b
On a.column_name = b.column_name
Inner Join Table3 as c
On b.column_name = c.column_name
Consider the following tables : Salary:
Emp_id | Emp_salary | Emp_name |
---|---|---|
01 | 25000 | Chandan |
02 | 30000 | Adhiraj |
03 | 25000 | Akshat |
Employee_record:
Emp_id | Emp_city | Emp_name |
---|---|---|
201 | noida | Sara |
202 | gurgaon | fatima |
Employee_details:
Emp_id | Emp_lastname |
---|---|
201 | Chauhan |
202 | Singh |
Query to join three tables :
select *
from salary as a
Inner Join Employee_record as b
On a.Emp_id = b.Emp_id
Inner Join Employee_details as c
on b.Emp_id = c.Emp_id
Emp_id | Emp_salary | Emp_name | Emp_id | Emp_city | Emp_name | Emp_id | Emp_lastname |
---|---|---|---|---|---|---|---|
01 | 25000 | Chandan | 201 | noida | Sara | 201 | Chauhan |
02 | 30000 | Adhiraj | 202 | gurgaon | fatima | 202 | Singh |
No comments:
Post a Comment