O'Reilly logo

Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts by John Adolph Palinski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Subqueries

Subqueries are SELECT statements that retrieve values from the database. The subquery then supplies the values as an argument in a calling SELECT statement. Subqueries that return actual values to the calling SELECT statement are executed before the calling SELECT statement is executed. Correlated subqueries are another type that is executed once for each potential record that the calling SELECT statement retrieves. Correlated subqueries test for existence and return a Boolean value to the calling SELECT statement. If the Boolean is false, the calling SELECT statement discards the record.

Subqueries are also used with DML commands such as INSERT to create a set of records that can be added to a table. We have also seen (in Chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required