Oracle - Union All
In Oracle, the UNION ALL operator is used to combine the result sets of 2 or more SELECT statements. It is different from UNION operator in a way that it does not remove duplicate rows between the various SELECT statements. It returns all of the rows.
Each SELECT statement within the UNION ALL must have the same number of fields in the result sets with similar data types.
In very simple words the difference between UNION and UNION ALL is that UNION will omit duplicate records whereas UNION ALL will include duplicate records.
SELECT expression1, expression2, ... expression_n FROM table1 WHERE conditions UNION ALL SELECT expression1, expression2, ... expression_n FROM table2 WHERE conditions;
SELECT supplier_id FROM suppliers UNION ALL SELECT supplier_id FROM order_details;
The above example will return the supplier_id multiple times in the result set if the same value appeared in both the supplier_id and order_details table.
What Is Oracle
posted on 2019-11-29 01:11:21 - ORACLE Tutorials
ORACLE - Trigger
posted on 2019-11-28 22:14:22 - ORACLE Tutorials
ORACLE - Cursor
posted on 2019-11-28 22:13:54 - ORACLE Tutorials
MySQL - Triggers
posted on 2019-11-29 21:44:07 - mysql Tutorials
MySQL - Grant_ Revoke Privilege
posted on 2019-11-26 23:15:04 - mysql Tutorials
MySQL Vs SQL
posted on 2019-11-25 05:02:26 - mysql Tutorials