11Subqueries

“We can’t solve problems by using the same kind of thinking we used when we created them.”

—ALBERT EINSTEIN

In the previous three chapters, I showed you many ways to work with data from more than one table. All the techniques I’ve covered to this point have been focused on linking subsets of information—one or more columns and one or more rows from an entire table or a query embedded in the FROM clause. I’ve also explored combining sets of information using the UNION operator. In this chapter, I’ll show you effective ways to fetch a single column from a ...

Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th 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.