SQL分页
来源:互联网 发布:最好的听书软件 编辑:程序博客网 时间:2024/06/05 19:55
/*sql分页
pagenum 页数
pagerecord 每页记录数*/
--方法一:
select * from (SELECT t.student_code,
t.name,
t.sex,
t.identity,
row_number() over (order by t.student_code asc) as sortid
FROM test01 T, test02 T1
WHERE T.COLLEGE_CODE = T1.COLLEGE_CODE
and t1.of_province = '62'
and t.study_start = '20150901'
)
where sortid between &pagenum*&pagerecord-(&pagerecord -1)
and &pagenum*&pagerecord;
--方法二:
select *
from (select t.*, rownum
from (SELECT t.student_code,
t.name,
t.sex,
t.identity,
rownum as sortid
FROM test01 T, test02 T1
WHERE T.COLLEGE_CODE = T1.COLLEGE_CODE
and t1.of_province = '62'
and t.study_start = '20150901') t)
where sortid between &pagenum * &pagerecord - (&pagerecord - 1) and
&pagenum * &pagerecord;
pagenum 页数
pagerecord 每页记录数*/
--方法一:
select * from (SELECT t.student_code,
t.name,
t.sex,
t.identity,
row_number() over (order by t.student_code asc) as sortid
FROM test01 T, test02 T1
WHERE T.COLLEGE_CODE = T1.COLLEGE_CODE
and t1.of_province = '62'
and t.study_start = '20150901'
)
where sortid between &pagenum*&pagerecord-(&pagerecord -1)
and &pagenum*&pagerecord;
--方法二:
select *
from (select t.*, rownum
from (SELECT t.student_code,
t.name,
t.sex,
t.identity,
rownum as sortid
FROM test01 T, test02 T1
WHERE T.COLLEGE_CODE = T1.COLLEGE_CODE
and t1.of_province = '62'
and t.study_start = '20150901') t)
where sortid between &pagenum * &pagerecord - (&pagerecord - 1) and
&pagenum * &pagerecord;
0 0
- Sql 分页
- SQL 分页
- sql分页
- sql分页
- sql分页
- sql分页
- SQL分页
- SQL分页
- sql分页
- sql 分页
- SQL分页
- SQL分页
- sql 分页
- 分页SQL
- SQL分页
- sql 分页
- sql分页
- 分页SQL
- poj2486 树形dp
- 关于SVM的那点破事[faruto长期更新整理]
- 实现frame框架窗口间的关联及超链接的target属性的使用
- [原创]配置Dev c++热键实现快速注释
- 1098. Insertion or Heap Sort (25)
- SQL分页
- build.prop参数详解和部分修改
- 多节点Kubernetes安装
- 【周练2016.3.7】B - Lucky Numbers(位运算,水)
- 统计与R入门
- PHP高效率写法
- 如何学习计算机图形学
- js var变量具体含义和用法
- 贾扬清分享_深度学习框架caffe