...

Database Managment - Oracle

Back to Course

Lesson Description


Lession - #1438 Oracle UNION ALL Operator


Oracle UNION ALL Operator

In Oracle, the UNION ALL administrator is utilized to consolidate the outcome sets of at least 2 SELECT proclamations. It is not the same as UNION administrator such that it doesn't eliminate copy columns between the different SELECT proclamations. It returns the columns as a whole. Each SELECT assertion inside the UNION ALL should have similar number of fields in the outcome sets with comparable information types.

Distinction among UNION and UNION ALL administrators

Association administrator eliminates copy columns while UNION ALL administrator doesn't eliminate copy lines.
Syntax:

SELECT expression1, expression2, ... expression_n  
FROM table1  
WHERE conditions  
UNION ALL  
SELECT expression1, expression2, ... expression_n  
FROM table2  
WHERE conditions;   		 


Parameters: 1>
expression1, expression2, expression_n: It determines your desired segments to recover. Number of articulations should be same in both SELECT proclamations. 2>
table1, table2: It determines the table name that you need to recover records from. 3>
conditions: It determines the circumstances that should be satisfied for the records to be selecte

Oracle UNION ALL Operator Example


SELECT supplier_id  
FROM suppliers  
UNION ALL  
SELECT supplier_id  
FROM order_details;