Chapter 9Creating Subqueries

Introduction

In this chapter you will learn how to retrieve records from multiple tables using correlated and non-correlated subqueries. You will also learn how to create nested subqueries and how to use the IN, EXISTS, ANY, SOME, NOT, and ALL keywords.

Keywords

ALL

ANY

EXISTS

IN

NOT

SOME

Definitions

ALL — Used to retrieve records from the main query that match all of the records in the subquery.

ANY — Used to retrieve records from the main query that match any of the records in the subquery.

Correlated subquery — Executes once for each record a referenced query returns.

EXISTS — Used to check for the existence of a value in the subquery.

IN — Used to compare values in a column against column values in another ...

Get SQL for Microsoft Access, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.