O'Reilly logo

Oracle SQL by Carol McCullough-Dieter, Gavin JT Powell

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

12

Subqueries

In this chapter:

  • What is a subquery?

  • What are the types of subqueries?

  • Where can subqueries be used?

  • Why do we need subqueries?

Subqueries are probably one of the more complex aspects of SQL. Sub-queries are often used to resolve complexity by breaking down large queries into many smaller queries, which interact with each other. In some situations, subqueries can also be used to improve SQL statement performance. Let’s begin by looking at types of subqueries.

12.1 Types of Subqueries

I like to think of subqueries such that there are two methods of categorizing subqueries. The first method of categorization is that a subquery can be scalar, correlated, nested, or an inline view. We will get to some of these types of subqueries ...

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