Showing posts with label union vs union all in sql union in sql. Show all posts
Showing posts with label union vs union all in sql union in sql. Show all posts

Sunday, September 6, 2020

SQL UNION ALL

 

SQL UNION ALL

SQL UNION ALL operator is used to combine the result sets of two or more select statements.

  1. UNION ALL operator allows duplicate values .
  2. All select statement within UNION ALL must have the same number of columns
  3. The columns must also have similar data types.
  4. The columns in each SELECT statement must also be in the same order

 SYNTAX

select column1, column2 ,... from table1 
UNION ALL 
select column1, column2 ,... from table2


SQL UNION ALL

  SQL UNION ALL SQL  UNION ALL  operator is used to combine the result sets of two or more select statements. UNION ALL operator allows dupl...