Thursday, November 27, 2014

Select nth row of a table in sql server

SELECT * FROM (
     SELECT     ROW_NUMBER() OVER (ORDER BY CategoryId) AS RowNo,CategoryId, CategoryName, LessThan, GreaterThan, AdvisorId, CategoryRating
          FROM CategoryMapping
WHERE     (AdvisorId = 1)

 ) AS foo
WHERE RowNo= 2

No comments:

Post a Comment