Sams Teach Yourself Transact-SQL in 21 Days, Second Edition
by Lowell Mauer, David Solomon, Bennett McEwan
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) ...
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