Showing posts with label what is union in sql server. Show all posts
Showing posts with label what is union in sql server. Show all posts

Monday, August 1, 2016

The SQL UNION Operator



The UNION operator is used to combine the result of two or more SELECT Statement. The UNION operator work when each select statement have same number of column, the column must have same data type and also the order of the columns in the each SELECT statement be the same.

Example -
Firstly we create two table names emp and employee


select id from emp
union
select id from employee

 Output - 


                                                            Author - Sachin Pathak