数据库分页sql
select * from (
select *,ROW_NUMBER() over (order by id) as rowNum
from cw_diy_scene where category_id = @categoryId
) as tab
where tab.rowNum between (@currPage - 1) * @pageSize + 1 and @pageSize * @currPage
select * from (
select *,ROW_NUMBER() over (order by id) as rowNum
from cw_diy_scene where category_id = @categoryId
) as tab
where tab.rowNum between (@currPage - 1) * @pageSize + 1 and @pageSize * @currPage