Top

The SELECT clause can have an optional TOP sub-clause. The TOP sub-clause specifies that only the first set of rows will be returned from the query result.

Syntax

[ TOP (n) ]

Arguments

n: The numeric expression that specifies the number of rows to be returned. n could be a single numeric literal or a single parameter.

Examples

select top(10) p from Products as p
select top(@topNum) p from Products as p

Last edited Mar 12, 2013 at 7:30 AM by ansiboy, version 2

Comments

No comments yet.