In MySQL, EXISTS operator allows you to check existence of any record in a subquery. The EXISTS operator return true if the subquery returns at least one row. The EXISTS operator can be used in a SELECT, INSERT, UPDATE, or DELETE statement.
To check existence of any record in a subquery, use the following syntax:
tablename: The table name from which you want to perform
subquery: Usually a SELECT statement starts with SELECT * or column name. MySQL ignores the SELECT list from subquery.
EXISTSoperator is uses the MySQL
In the above example, the EXISTS operator will return all records from the "tblbankdemataccountcharges" table where there is at least one record in the tblbankheadquartersandaddress table with the matching "bankId".
You can use MySQL Command Line Client to use EXISTS operator in subquery. It will look like this: