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)".
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
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
##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##4. If it returns false, the external SQL statement will not be executed as shown below
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.
Recommended learning:
mysql video tutorialThe 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!