To return only a certain number of records that fall at the top or the bottom of a range specified by an ORDER BY clause, use the TOP predicate. Suppose you want the names of the top 25 students from the class of 1994:
SELECT TOP 25 FirstName, LastName
FROM Students
WHERE GraduationYear = 1994
ORDER BY GPA DESC
If you do not include the ORDER BY clause, the query will return an arbitrary set of 25 records from the Students table that satisfy the WHERE clause.
The TOP predicate does not choose between equal values. In the preceding example, if the twenty-fifth and twenty-sixth highest ranked students have the same grade point average, the query will return 26 records.