O'Reilly logo

Sams Teach Yourself SQL in 24 Hours, Fifth Edition by Arie D. Jones, Ron D. Plew, Ryan Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hour 15. Combining Multiple Queries into One

What You’ll Learn in This Hour:

An overview of the operators that combine queries

When to use the commands to combine queries

Using the GROUP BY clause with the compound operators

Using the ORDER BY clause with the compound operators

How to retrieve accurate data

In this hour, you learn how to combine SQL queries by using the UNION, UNION ALL, INTERSECT, and EXCEPT operators. Once again, you must check your particular implementation for any variations in the use of these operators.

Single Queries Versus Compound Queries

The single query is one SELECT statement, whereas the compound query includes two or more SELECT statements.

You form compound queries by using some type of operator to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required