From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

IN clause subquery

IN clause subquery - SQL Tutorial

From the course: SQL Essential Training

IN clause subquery

- [Instructor] Up to this point, we've only used subqueries to calculate a singular value, which is then passed to the outer query. It is possible to use subqueries that return multiple records. Now, let's say that our WSDA Music Management team is interested in three particular invoices. To select these individual invoices, let's consider our present SQL statement here. We've used a SQL statement that is going to employ the IN operator, or the IN clause, to select three specific invoices, and our result is showing the invoice date that is associated with these three invoices. Now, let's say that we are asked if any purchases were made on these particular days. If we want to select all invoices for those three days, we can either start a brand new query, or we can just use our existing query here as a subquery. Let's go ahead and do that. Now, to create a subquery, as we said, let's put our existing query in a pair of…

Contents