0 votes
in Oracle by

What is a Sub Query? Describe its Types?

1 Answer

0 votes
by

A subquery is a SELECT statement that is embedded in a clause of another SELECT statement. A subquery can be placed in where having and from clause.

Guidelines for using subqueries:

You should enclose the sub-queries within parenthesis.

Place these subqueries on the right side of the comparison condition.

Use Single-row operators with single-row subqueries.

Use Multiple-row operators with multiple-row subqueries.

Types of subqueries:

Single-Row Subquery: Queries that return only one row from the inner select statement. Single-row comparison operators are: =, >, >=, <, <=, <>

Multiple-Row Subquery: These are queries that return more than one row from the inner Select statement. You will also find multiple-column subqueries that return more than one column from the inner select statement. Operators include: IN, ANY, ALL.

...