Oracle Union | union - oracle tutorial - sql tutorial

Oracle union

Learn oracle - oracle tutorial - Oracle union - oracle examples - oracle programs

What is Oracle UNION ?

  • The Oracle UNION operator is used to combine the result sets of 2 or more Oracle SELECT statements.
  • It removes duplicate rows between the various SELECT statements.


SELECT expression1, expression2, ... expression_n
FROM tables
[WHERE conditions]
SELECT expression1, expression2, ... expression_n
FROM tables
[WHERE conditions];
click below button to copy the code. By - oracle tutorial - team
  • Note : Each SELECT statement within the UNION operator must have the same number of fields in the result sets with similar data types.
Oracle union query

Oracle Union Query

Sample Database:

  • We have a table called wikitechy_employee with four fields (id, name, position, and city). It contains the following data:
 oracle union table
  • We have another table called orders with three fields (id, customer_name, and orderid).
 oracle union table
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql


SELECT City FROM wikitechy_employee
SELECT City FROM orders
click below button to copy the code. By - oracle tutorial - team


  • There must be same number of expressions in both SELECT statements.


 union output
  1. Select statement is used to select city column from the wikitechy_employee table and similarly city column from orders table.
  2. Union Keyword is used to combines distinct values in city column from both tables.
  3. If several employee and customers share same city, each city will only be selected.
  • Note: Use Union All keyword instead of union to select all the duplicate values.

Union UnionAll Except Intersect

Union UnionAll Except Intersect

This tutorial provides an indepth knowledge on the following items such as oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , mysql tutorial , sql tutorial for beginners , learn sql , oracle database tutorial , sql query tutorial , oracle dba tutorial , plsql tutorial , oracle tutorial pdf , oracle pl sql tutorial , oracle sql tutorial , sql tutorial point , oracle tutorial for beginners , learn oracle online free , learn oracle online , learning pl sql programming , learn sql online for free , sql learning online , dba oracle tutorial , oracle sql tutorial advanced , oracle 11g dba tutorial with examples , oracle online learning , oracle learning online , how to learn pl sql , sql coding tutorial , sql learning websites , sql basic learning

Related Searches to Oracle Union | UNION

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add to your ad blocking whitelist or disable your adblocking software.