DB2

推荐列表 站点导航

当前位置:首页 > 数据库 > DB2 >

在不同数据库中的使用的分页查询语句: 当前页:currentpage 页大小:pagesize 1. Oracle数据

来源:网络  作者:网友投稿  发布时间:2021-01-17 18:28
在差异数据库中的利用的分页查询语句:当前页:currentpage页巨细:pagesize1 Oracle数据库select*from(selectA *,rownumrnfrom(QUERY_...

字段3, 在差异数据库中的利用的分页查询语句: 当前页:currentpage 页巨细:pagesize 1. Oracle数据库 select * from (select A.*,rownumber() over(order by 排序用的列名 asc) as RN from 表名) as A1 where A1.RN between (currentpage*pagesize) and ((currentpage1)*pagesize) 或 select * from (select rownumber() over(order by id asc ) as rowid from table where rowid =((currentpage1)*pagesize) ) where rowid (currentpage*pagesize) 4. SQL Server数据库 select top pagesize * from TABLENAME where COLLUMN_NO not in (select top currentpage*pagesize COLLUMN_NO from TABLENAME order by COLLUMN_NO) order by COLLUMN_NO 5. Sybase数据库 Sybase 12.5.3版本支持top查询, column_name into #TEMPTABLE from TABLENAME select column_name from #TEMPTABLE where rowid (currentpage*pagesize) and rowid (currentpage*pagesizepagesize) 6. MySQL数据库 SELECT * FROM TABLE1 LIMIT (currentpage*pagesize)。

或利用set rowcount N查询头N条数据 别的回收姑且表: select rowid=identity(12), 或 select * from (select rownum rn,id from TABLENAME where rownum =((currentpage1)*pagesize) ) A where A.rn = (currentpage*pagesize) 2. Infomix数据库 select skip currentpage first pagesize * from TABLENAME 3. DB2数据库 select * from (select 字段1。

字段2。

pagesize ,rownum rn from ( QUERY_SQL ) A ) where rn = ((currentpage1)*pagesize) and rn (currentpage*pagesize) 注:QUERY_SQL为查询sql语句,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/sql/db2/12774.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

在不同数据库中的使用的分页查询语句: 当前页:currentpage 页大小:pagesize 1. Oracle数据

2021-01-17 编辑:网友投稿

字段3, 在差异数据库中的利用的分页查询语句: 当前页:currentpage 页巨细:pagesize 1. Oracle数据库 select * from (select A.*,rownumber() over(order by 排序用的列名 asc) as RN from 表名) as A1 where A1.RN between (currentpage*pagesize) and ((currentpage1)*pagesize) 或 select * from (select rownumber() over(order by id asc ) as rowid from table where rowid =((currentpage1)*pagesize) ) where rowid (currentpage*pagesize) 4. SQL Server数据库 select top pagesize * from TABLENAME where COLLUMN_NO not in (select top currentpage*pagesize COLLUMN_NO from TABLENAME order by COLLUMN_NO) order by COLLUMN_NO 5. Sybase数据库 Sybase 12.5.3版本支持top查询, column_name into #TEMPTABLE from TABLENAME select column_name from #TEMPTABLE where rowid (currentpage*pagesize) and rowid (currentpage*pagesizepagesize) 6. MySQL数据库 SELECT * FROM TABLE1 LIMIT (currentpage*pagesize)。

或利用set rowcount N查询头N条数据 别的回收姑且表: select rowid=identity(12), 或 select * from (select rownum rn,id from TABLENAME where rownum =((currentpage1)*pagesize) ) A where A.rn = (currentpage*pagesize) 2. Infomix数据库 select skip currentpage first pagesize * from TABLENAME 3. DB2数据库 select * from (select 字段1。

字段2。

pagesize ,rownum rn from ( QUERY_SQL ) A ) where rn = ((currentpage1)*pagesize) and rn (currentpage*pagesize) 注:QUERY_SQL为查询sql语句,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://www.juheyunku.com/sql/db2/12774.shtml

相关文章

风云图片

推荐阅读

返回DB2频道首页