Collections:
Use Subqueries with the EXISTS Operator in Oracle
How To Use Subqueries with the EXISTS Operator in Oracle?
✍: FYIcenter.com
A subquery can be used with the EXISTS operator as "EXISTS (subquery)", which returns true if the subquery returns one or more rows. The following statement is a good example of "EXISTS (subquery)". It returns rows from employees table that there are rows existing in the departments table linked to the employees table with location_id = 1700.
SQL> SELECT first_name, last_name FROM employees e 2 WHERE EXISTS ( 3 SELECT * FROM departments d 4 WHERE e.department_id = d.department_id 5 AND d.location_id = 1700 6 ); FIRST_NAME LAST_NAME -------------------- ------------------------- Steven King Neena Kochhar Lex De Haan Nancy Greenberg Daniel Faviet John Chen Ismael Sciarra ......
2019-09-27, 914👍, 0💬
Popular Posts:
How to set database to be READ_ONLY in SQL Server? Databases in SQL Server have two update options: ...
How To Format DATETIME Values to Strings with the CONVERT() Function in SQL Server Transact-SQL? SQL...
How To Provide Values to Stored Procedure Parameters in SQL Server Transact-SQL? If a stored procedu...
How to run Queries with SQL Server Management Studio Express in SQL Server? 1. Launch and connect SQ...
How To Calculate Age in Days, Hours and Minutes in SQL Server Transact-SQL? On many Web sites, news ...