Day 2. Filtering and Sorting Data

In yesterday's lesson, you learned a little about what SQL is and how it relates to the SQL Server database. In addition, you were introduced to the Query Analyzer and some of its features. Using the Query Analyzer, you executed your first SQL query, returning all the data in the Employees table of the Northwind database.

Today, you will learn how to limit the number of rows you get back, and to sort those rows in a particular order, based on one or more columns returned in the query. These actions are the backbone of almost every SQL query that you will run. In fact, you can see an example of this at home in your bank statement. Each month you get a report (statement) that shows only the last month's data (filtering) ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second 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.