How to add(merge) three or four table in a single SQL query ?

using FULL OUTER JOIN 

Table -1 + Table-2 + Table-3

Last updated:12/11/2018 12:46:19 AM

2 Answers

Sanat Shukla
Sanat Shukla

Hi, Rahul

Please, use this query ...

1). If you want to Merge Two Tables...

SELECT * FROM 

Table_1
FULL OUTER JOIN
Table_2 ON Table_1.colomn_name = Table_2.column_name

2). And if you want to add three or four table by a single query...

SELECT * FROM 

Table_1
FULL OUTER JOIN
Table_2 ON Table_1.EmployeeName = Table_2.EmployeeName
FULL OUTER JOIN
Table_3 ON Table_2.EmployeeName = Table_3.EmployeeName

Note - Foreign keys must be used in all the tables in which the tables that we call them to join. This means that all those tables should have a common column name.

Nitin Lahoti
Nitin Lahoti

I would like to suggest join concept to add multiple tabe in a single query as per above post mr.SANAT  plz use this one.

Answer