How to use the UNION operator in Oracle to join two similar tables
Want to use the UNION operator in Oracle? Learn how to do so to join two different tables with the same number of columns and column names.
SELECT col1, col2, col3 FROM table1 UNION SELECT col1, col2, col3 FROM table2;
You can even use the UNION operator on two tables that have different numbers of columns, so long as you fill in the missing columns with NULL values as can be seen below:
SELECT col1, NULL as col2, col3 FROM table1 UNION SELECT col1, col2, NULL as col3 FROM table2;