The EXISTS predicate can be used to check for the existence of specific rows. The query_expression returns rows rather than values. The predicate evaluates to true if the number of rows returned by the query_expression is non zero.
Syntax
exists_predicate ::
EXISTS ( query_expression )
Example
IF EXISTS (SELECT * FROM order_tbl WHERE order_tbl.custid = 325)
In this example, the predicate will evaluate to true if the specified customer has any orders.