Murach's SQL Server 2008 for Developers
How to code subqueries

This chapter teaches you how to code subqueries. A subquery is a SELECT statement that's coded within another SQL statement, allowing you to do more complex queries than you could otherwise.

Chapter 6 How to code subqueries
An introduction to subqueries 180
How to use subqueries 180
How subqueries compare to joins 182
How to code subqueries in search conditions 184
How to use subqueries with the IN operator 184
How to compare the result of a subquery with an expression 186
How to use the ALL keyword 188
How to use the ANY and SOME keywords 190
How to code correlated subqueries 192
How to use the EXISTS operator 194
Other ways to use subqueries 196
How to code subqueries in the FROM clause 196
How to code subqueries in the SELECT clause 198
Guidelines for working with complex queries 200
A complex query that uses subqueries 200
A procedure for building complex queries 202
How to work with common table expressions 204
How to code a CTE 204
How to code a recursive CTE 206
t




Murach's SQL Server 2008

Learn more about this book

View the table of contents


More about the eBook



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.