Monday, November 14, 2011

How to get nth record in sql

To get nth record in sql use the following sql query:
User with clause
with ordered as(select  *,ROW_NUMBER() over(order by community_ID) as id from dbo.Communities) select * from  ordered where id=nth



No comments:

Post a Comment