摘要:
数据库的分页查询一般由两个查询组成:select count(*) from Goods和select *from ( select row_number() over(order by goodsId) as rowid, * from Goods) as awhere rowid >= @pageSize * (@pageIndex - 1) + 1and rowid = @pageSize * (@pageIndex - 1) + 1and rowid <= @pageSize * @pageIndex 经过测试,由于在同一个查询中,都使用了over()窗口函数,Sql... 阅读全文