What is EXISTS Predicate in SQL?

What is EXISTS Predicate in SQL Queries? give me syntax


Views: 1163 | Community Opinion: 2

Tags..  SQL Queries

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 

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.




bhaskar Said..

select * from dept where exit(select deptno from emp)






What do you think? Add your opinion/answer
*Name
*your opinion/answer: