Logo 
Search:

Oracle Articles

Submit Article
Home » Articles » Oracle » OperatorsRSS Feeds

using NOT EXISTS

Posted By: Arnelle Schmidt     Category: Oracle     Views: 3178

This article explains about using NOT EXISTS with example.

Customer - orders - salespeople database

using NOT EXISTS

Find all salespersons having only 1 customer.

SELECT DISTINCT snum FROM Customers outer WHERE NOT EXISTS  (SELECT * FROM Customers inner WHERE inner.snum=outer.snum AND inner.cnum <> outer.cnum);

 

  
Share: 


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

Arnelle Schmidt
Arnelle Schmidt author of using NOT EXISTS is from Frankfurt, Germany.
 
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!