Saturday 19 July 2014

SQL Union


Union All
If you want to join 2 tables rows then use Union all.
Both table should have same number of columns while doing Union All and Same Data Type.
>> Join will used to join 2 tables column wise.
Union: Is is similar to Union All, but Union Will return only distinct values (Rows)
Ex:
Select * from IT
Union All
Select * from HR
Union
Select * from Sales