Joins or Subqueries?

As you develop your SQL style, you will use both joins and subqueries for your multitable queries. They can often be used interchangeably to solve a given problem; in these cases, whether you use a join or a subquery is simply a matter of individual preference. Some SQL users automatically reach for a subquery, while others prefer joins. However, each has particular advantages and disadvantages.

Get Practical SQL Handbook, The: Using SQL Variants, Fourth 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.