数据库分页方式大全

翻译|其它|编辑:郝浩|2004-01-16 22:04:00.000|阅读 2559 次

概述:

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>

1。用next()方法,
选从50-100行
int CurrentRow = 1;
int MinRow = 50;
int MaxRow = 100;
while(rs.next())
{
if (CurrentRow {
CurrentRow++;
continue;
}
}
2.用absolute(int row)定位
先定位到50行,然后next();
3.用sql完成
SqlServer的语句:select top 50 * from (select top 100 * from sysobjects order by id) as a order by id desc
Oracle的语句:
select * from (select rownum r ,* from test) ss
where ss.r > 50 and ss.r <= 100;
测试速度 :
absolute()最慢;定位到10000条以后无法忍受!
next();前面几条快,越往后越慢!
SqlServer语句,比next快很多,但也是越往后越慢!
Oracle语句,最快!几乎不受条数影响!

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com


为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP