10UNIONs

“I beseech those whose piety will permit them reverently to petition, that they will pray for this union.”

—SAM HOUSTON, TEXAS HERO

In Chapter 7, “Thinking in Sets,” I introduced three fundamental set operations—intersection, difference, and union. Chapter 8, “INNER JOINs,” showed how to perform the equivalent of an intersection operation by linking result sets on key values using INNER JOIN. Chapter 9, “OUTER JOINs,” discussed how to ask for a set difference by using an OUTER JOIN and testing for the Null value. This chapter explains how to do the third operation, a UNION.

What Is a UNION? ...

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.