Oracle Minus | Sql Minus - oracle tutorial - sql tutorial
![Oracle minus](https://wikitechy.com/tutorials/oracle/img/oracle-images/oracle-minus.gif)
Learn oracle - oracle tutorial - Oracle minus - oracle examples - oracle programs
What is Oracle MINUS ?
- MINUS operator is used to return all rows in the first SELECT statement that are not returned by the second SELECT statement.
- Each SELECT statement has a dataset and the MINUS operator returns all documents from the first dataset and then removes all documents from the second dataset.
![](https://wikitechy.com/tutorials/oracle/img\oracle-images\minus.png)
Syntax:
SELECT column_name
FROM table1_name
MINUS
Select column_name
FROM table2_name
click below button to copy the code. By - oracle tutorial - team
Example:
SELECT name
FROM wikitechy_employee
MINUS
Select name
FROM wikitechy_employee1;
click below button to copy the code. By - oracle tutorial - team
Code Explanation:
Before Execution:
- Table1 is shown
![](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-minus-table-1.png)
- Table2 is shown
![](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-minus-table-2.png)
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql
AFTER EXECUTION:
![](https://wikitechy.com/tutorials/oracle/img\oracle-images\oracle-minus-query.png)
- Using the “MINUS statement“ The given query returns only rows returned by the first query but not by the second.
Oracle Union - Oracle UnionAll - Oracle Except - Oracle Intersect
![Union UnionAll Except Intersect](https://wikitechy.com/tutorials/oracle/img\oracle-images\union-unionall-except-intersect.jpg)