Oracle SQL – Subquery Introduction
Last Updated on :September 29, 2019
A SQL Subquery is a select statement that is nested within another SQL.It allow you to use output from one query as input of another SQL statement.
Subquery is usually added in the WHERE clause of a SELECT,UPDATE or DELETE statement and SET clause of an UPDATE statement.
A subquery in the FROM clause of a select statement is called INLINE VIEW.
Types of Subqueries
1. Noncorrelated subquery
In noncorrelated subquery, inner query does not depend on outer query. Noncorrelated subquery can be categorized as follows
- Single row subquery / Scalar Subquery
- Multiple row subquery
- Multiple column subquery
2. Correlated Subquery
Correlated subquery depends on values provided by outer subquery
We will be discussing details on subquery with examples in next tutorials.