Oracle EXISTS

The Oracle EXISTS condition tests for existence of rows in a subquery.

Oracle EXISTS example

Select *
From books
Where EXISTS
(Select *
From sales s
Where b.book_id = s.book_id);

Oracle NOT EXISTS example

Select *
From invoices i
Where NOT EXISTS
(Select *
From payments p
Where i.invoice_no = p.invoice_no);