The TOP clause of the SELECT statement limits the number of rows returned in the result set.
If PERCENT is not specified, n is the number of rows to return.
If PERCENT is specified, n is the percentage of the result set rows to return. In this case n must be an integer between 0 and 100.
If a SELECT statement that includes TOP also has an ORDER BY clause, the rows to be returned are selected from the ordered result set.
Example: The following example retrieves only first 7 rows from the query:
SELECT TOP 7 col1 FROM tab1
|