javascript和JQuery焦点图和代码特效大全
当前最流行的开源CMS网站系统大全
当前位置:首页 > 数据库 > db2

DB2,Oracle,SQLserver,Mysql分页查询语句

来源:IT技术网编辑:雨天发布于:2017-06-19人围观

DB2,Oracle,SQLserver,Mysql分页查询语句

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
db2:
select t1.* from (
    select t.*,rownumber() over(order by t.id ASC)) as rn from t_students t
) as t1 where t1.rn between (pageNum-1)*pageSize and pageNum*pageSize
 
 
Oracle:
select * from (
    select t.*,t.rownum from t_student t
) where rownum>pageSize*(pageNum-1) and rownum<=pageSize*pageNum;
 
sql server:
select top pageSize t.* from t_students t
where t.id not in (
    select top (pageNum-1)*pageSize t1.id from t_students t1 order by t1.id
)order by t.id;
 
mysql:
select * from t_students t limt (pageNum-1)*pageSize,pageSize;

上一篇:MongonDB入门

下一篇:初识mongodb----索引

与相关的文章
有时间的话来看看IT界的突发事件