OFFSET / FETCH

In the March 2011 edition of SQL Server Magazine, Itzik Ben-Gan has a great article on a new feature to be introduced in SQL Server Denali.
OFFSET/FETCH will be part of the ORDER BY clause, and functions much like the TOP clause.
With OFFSET x, you can specify to skip the first x rows in a result set. x can be 0.
With FETCH, you can specify to return the next 10 rows (FETCH NEXT 10 ROWS ONLY), or the first set of rows (FETCH FIRST 10 ROWS ONLY).
FETCH can be left off, to skip the first x number of rows and then return the rest.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: