![How to use exists in oracle](https://img.php.cn/upload/article/000/000/040/5e621d29ec86b747.jpg)
Usage of exists in oracle
1. exists is followed by a subquery
![1583488357112650.png How to use exists in oracle](https://img.php.cn/upload/image/362/475/807/1583488357112650.png)
2. The following two tables are used as examples to demonstrate that the id in table a is associated with the aid in table b
Recommended learning: SQL tutorial
![1583488354475440.png How to use exists in oracle](https://img.php.cn/upload/image/812/415/577/1583488354475440.png)
3. The function of exists is to check whether the result of the subquery is true. If the subquery is true, the outer SQL statement is executed. exists does not return data and only returns true or false
![1583488352685990.png How to use exists in oracle](https://img.php.cn/upload/image/947/222/949/1583488352685990.png)
##4. If it returns false, the external SQL statement will not be executed as shown below
![158348835011180How to use exists in oracle How to use exists in oracle](https://img.php.cn/upload/image/868/831/276/158348835011180How%20to%20use%20exists%20in%20oracle)
5. Its usage is somewhat similar to in, but sometimes the efficiency is different when the amount of data is relatively large, but the efficiency is the same when the amount of data is relatively small.
![1583488347217317.png How to use exists in oracle](https://img.php.cn/upload/image/458/498/200/1583488347217317.png)
For more oracle related tutorials, please pay attention to
PHP Chinese website!
The above is the detailed content of How to use exists in oracle. For more information, please follow other related articles on the PHP Chinese website!
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn