SQL UNION Operator to Concatenate Query Result

SQL UNION Operator to Concatenate Query Result

Instructor-svgAl-Mamun Sarkar
Apr 15 , 2020

SQL UNION Operator to Concatenate Query Result. The following SQL command shows how to use SQL UNION Operator to concatenate result of two different Query. 

 

SQL UNION Syntax:

SELECT column FROM table_name
UNION
SELECT column FROM table_name; 

Example:

SELECT name FROM customers
UNION
SELECT name FROM employees; 

 

UNION ALL Syntax:

SELECT column FROM table_name
UNION ALL
SELECT column FROM table_name; 

 

Example:

SELECT name FROM customers
UNION ALL
SELECT name FROM employees; 

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram