Monday, December 1, 2008

SQL Combine 2 Different Table

This SQL is use to combine 2 different table together for other purpose.
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
NameSalary
emil1000
rayden2000


Table Name: Flight
FligtTicketPrice
Kuala Lumpur265
Bangkok878


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

Col1Col2
emil1000
rayden2000
Kuala Lumpur265
Bangkok878

6 comments:

Alishana said...

WoW nice blog buddy!Actually WoW is my favorite appreciation keyword.I also like to play. Wow Gold. I was looking for info regarding that and saw your website. Its nice and very interesting.

mindbees said...

Aion kinah



Wonderful blog

mindbees said...

wow gold kaufen


Nice blog,read

dharmendra said...

this query returns one error i,s
ISNULL invalid identifier.plez leave your repl anybody

Misael Fuentes DICEX said...

Gracias!!!
Thanks!!!
From: Mexico.

Misael Fuentes DICEX said...

Gracias! Thanks!
From Mexico.