Versions available for this page: CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
The EXISTS conditional expression returns TRUE if one or more results of the execution of the subquery specified on the right exist, and returns FALSE if the result of the operation is an empty set.
EXISTS expression
--selecting rows using EXISTS and subquery
SELECT 'raise' FROM db_root WHERE EXISTS(
SELECT * FROM condition_tbl WHERE salary < 2500000);
=== <Result of SELECT Command in Line 2> ===
'raise'
======================
'raise'
--selecting rows using NOT EXISTS and subquery
SELECT 'raise' FROM db_root WHERE NOT EXISTS(
SELECT * FROM condition_tbl WHERE salary < 2500000);
=== <Result of SELECT Command in Line 2> ===
There are no results.
0 rows selected.