Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012
by Dejan Sarka Itzik Ben-Gan and Ron Talmage
Chapter 3. Filtering and Sorting Data
Exam objectives in this chapter:
Work with Data
Query data by using SELECT statements.
Implement data types.
Modify Data
Work with functions.
Filtering and sorting data are the most foundational, as well as most common, aspects of querying data. Almost every query that you write needs to filter data, and many queries involve sorting. The traditional way to filter data in T-SQL is based on predicates. However, T-SQL also supports filtering data based on another concept—a specified number of rows and ordering. The options T-SQL supports based on this concept are TOP and OFFSET-FETCH. As for sorting, even though it might seem like a trivial aspect of querying, it’s actually a source for quite a lot of confusion and ...
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