SELECT ISNULL(a.Col1,b.Cola) , ISNULL(a.Col2,b.Colb)
FROM Table1 a
FULL JOIN Table2 b
ON a.Col1 = b.Cola
Here is 2 Different Table,
Table Name : Salary
Name | Salary |
emil | 1000 |
rayden | 2000 |
Table Name: Flight
FligtTicket | Price |
Kuala Lumpur | 265 |
Bangkok | 878 |
Below Sql is use to combine above 2 Tables Become below 1 Table
SELECT ISNULL(a.Name,b.FlightTicket) AS Col1, ISNULL(a.Salary,b.Price) AS Col2 FROM Salary a
FULL JOIN Flight b ON a.Name = b.FlightTicket
Col1 | Col2 |
emil | 1000 |
rayden | 2000 |
Kuala Lumpur | 265 |
Bangkok | 878 |