The Oracle UNION operator is allow you to combine the result-set of two or more SELECT statements together. It combines the both SELECT statement and removes duplicate rows between them. If SELECT statement have the same number of columns with similar data types and it should be in the same order.
To combine the result-set of two or more SELECT statements together, use the following syntax:
Parameters:
tablename: The table name from which you want to perform UNION operator.
UNION: To combine the result-set of two or more SELECT statements.
Note:
In the above example, the UNION operator will return all distinict records from "tblCustomer" and "tblCustomerLoan" table.
You can use Oracle Command Line Client to use UNION operator to combine the result-set of two or more SELECT statements together. It will look like this: