SQL中的分页

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL中的分页相关的知识,希望对你有一定的参考价值。

Call it in the button click event after in(de)crementing CurrentPage value
  1. DataTable dtAllProductsView = DB.GetData(@"
  2. SELECT TOP " + itemsNb + @" *
  3. FROM
  4. (SELECT
  5. ROW_NUMBER() OVER (ORDER BY id) AS RowNumber,
  6. *
  7. FROM
  8. [vwAllProductData]
  9. WHERE
  10. [" + promotion + @"] LIKE 'True' AND
  11. active = 'True'
  12. ) _rowNbResult
  13. WHERE
  14. RowNumber > " + CurrentPage + @" * " + itemsNb);

以上是关于SQL中的分页的主要内容,如果未能解决你的问题,请参考以下文章

存储过程sql server中的分页

SQL中的分页

在oracle数据库中的分页SQL语句怎么写?

SQL Server中的分页查询 select top

No-sql数据库中的分页

Mybatis里SQL语句的分页