...

Database Managment - Oracle

Back to Course

Lesson Description


Lession - #1440 Oracle Minus Operator


Oracle MINUS operator

In Oracle, MINUS administrator is utilized to return all lines in the primary SELECT articulation that are not returned constantly SELECT explanation. Each SELECT assertion has a dataset and the MINUS administrator returns all records from the first dataset and afterward eliminates all reports from the second dataset.
Syntax:

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


Parameters: 1>
expression1, expression2, ... expression_n: It indicates your desired sections to recover.
2>
table1, table2: it indicates your desired tables to recover records from.
3>
conditions: it indicates the circumstances that should be satisfied for the records to be chosen.

Oracle MINUS Example

This example will return one field with the same datatype from two tables "suppliers" and "order_details".

SELECT supplier_id  
FROM suppliers  
MINUS  
SELECT supplier_id  
FROM order_details;