Types of Subqueries


There are two basic types of subqueries:

  • Single row subqueries    Return zero or one row to the outer SQL statement.

  • Multiple row subqueries    Return one or more rows to the outer SQL statement.

In addition, there are three subtypes of subqueries that may return single or multiple rows:

  • Multiple column subqueries    Return more than one column to the outer SQL statement.

  • Correlated subqueries    Reference one or more columns in the outer SQL statement. The subquery is known as a correlated subquery because the subquery is related to the outer SQL statement.

  • Nested subqueries    Are placed within another subquery. You can nest subqueries to a depth of 255.

You ll learn about each of these types of subqueries in this chapter, and see how to add subqueries to SELECT , UPDATE , and DELETE statements. Let s plunge in and look at how to write single row subqueries.




Oracle Database 10g SQL
Oracle Database 10g SQL (Osborne ORACLE Press Series)
ISBN: 0072229810
EAN: 2147483647
Year: 2004
Pages: 217

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net