Sql 分页语句
/**分页SQL**/
SELECT ROW_NUMBER() OVER(ORDER BY ID DESC) AS rowIndex,* from TableName where rowIndex BETWEEN @PageIndex AND @PageSize
select * from (select *,ROW_NUMBER()over(order by [ID]) as rowindex from product ) tb where rowindex between " + ((pageIndex - 1) * pageSize + 1) + " and " + pageIndex * pageSize
--关键语句:--
ROW_NUMBER()over(order by [ID]) as rowindex