Logo 
Search:

Oracle Articles

Submit Article
Home » Articles » Oracle » OperatorsRSS Feeds

INTERSECTION OPERATOR

Posted By: Sienna Hughes     Category: Oracle     Views: 1912

This article explains about using INTERSECTION OPERATOR with example.

Customer - orders - salespeople database

INTERSECTION OPERATOR

Find the salespeople who have taken orders of more than 1000 and who have less than 2 customers assigned.

SELECT snum FROM Orders a 
            WHERE 1000 < (SELECT SUM(amount) FROM Orders b WHERE b.snum = a.snum)
INTERSECT
SELECT snum FROM Salespeople c WHERE 2 > (SELECT count(*) FROM Customers d WHERE d.snum = c.snum);
  
Share: 

 
 
 

Didn't find what you were looking for? Find more on INTERSECTION OPERATOR Or get search suggestion and latest updates.

Sienna Hughes
Sienna Hughes author of INTERSECTION OPERATOR is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!