Murach's SQL Server 2005 for Developers
How to retrieve data from a single table

This chapter shows you how to use the SQL SELECT statement to retrieve data from a single table. However, the skills covered are the essential ones that apply to any SELECT statement, no matter how many tables it operates on or how complex the retrieval.

Chapter 3 How to retrieve data from a single table
An introduction to the SELECT statement 80
The basic syntax of the SELECT statement 80
SELECT statement examples 82
How to code the SELECT clause 84
How to code column specifications 84
How to name the columns in a result set 86
How to code string expressions 88
How to code arithmetic expressions 90
How to use functions 92
How to use the DISTINCT keyword to eliminate duplicate rows 94
How to use the TOP clause to return a subset of selected rows 96
How to code the WHERE clause 98
How to use comparison operators 98
How to use the AND, OR, and NOT logical operators 100
How to use the IN operator 102
How to use the BETWEEN operator 104
How to use the LIKE operator 106

How to use the IS NULL clause

108

How to code the ORDER BY clause 110
How to sort a result by a column name 110
How to sort a result set by an alias, an expression, or a column number 112
Perspective 114
t




Murach's SQL Server 2005

Learn more about this book

Download this chapter

View the table of contents

Add this book to your cart



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.