Sams Teach Yourself Transact-SQL in 21 Days, Second Edition
by Lowell Mauer, David Solomon, Bennett McEwan
Summary
Congratulations, you have made it to the end of the day. If your head hurts, don't worry, it's temporary. Today, you learned everything you ever wanted to know about subqueries, but didn't know to ask. You saw how to use subqueries that return single results, as well as subqueries that return lists, and subqueries that do the work of inner joins. In addition, you saw how to use subqueries to return aggregate information, which you would then use in a normal query (one that doesn't use a GROUP BY clause).
You also learned how to use both the IN and EXISTS conditions in the WHERE clause to select data when using subqueries. In tomorrow's lesson, you will learn how to manipulate the data that is in the database by using the INSERT, UPDATE, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access