Home >Database >Oracle >What is the usage of exists in oracle

What is the usage of exists in oracle

WBOY
WBOYOriginal
2022-01-05 15:43:4237944browse

In Oracle, the function of exists is to check whether the result of the subquery is true. If the subquery is true, the outer SQL statement will be executed. If it returns false, the outer SQL statement will not be executed. The syntax is " select * from daul where exists (condition)".

What is the usage of exists in oracle

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

What is the usage of exists in oracle

1.exists is followed by a subquery as shown below

What is the usage of exists in oracle

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

What is the usage of exists in oracle

##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

What is the usage of exists in oracle##4. If it returns false, the external SQL statement will not be executed as shown below

What is the usage of exists in oracle5. 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.

What is the usage of exists in oracle Recommended learning:

mysql video tutorial

The above is the detailed content of What is the usage of 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