The Row_Number() function in SQL is used to assign sequence number for each record retrieved for a collection of records.
Hence, we can use this function to retrieve a portion of records (Custom) from the collection of records.
Syntax:
SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY [Field Used for Sorting])AS Row, * FROM ([Select Query])AS UserQuery) AS SelectionWithRowNumbers WHERE Row >[First Record]AND Row<=[Last Record]
Tuesday, August 26, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment