select * from(select *,ROW_NUMBER() over(order by id)as 'userID' from UserInfo) as a where a.userID between 31 and 40