Search the Blog

Monday, July 15, 2019

SQL EXISTS OPERATOR syntax and Query

The EXISTS operator is used to test  the existence of any record in a subquery and 
returns true if the subquery returns one or more records.

SYNTAX-

SELECT column_name(s)
FROM table_name
WHERE EXISTS
(SELECT column_name FROM table_name WHERE condition);

QUERY-

select account_name,account_city from account_master where exists(select acc_code from invoice_master where balance_amount>10000)

No comments:

Post a Comment

Translate