请问高手:大数据量情况下如何返回指定条数的记录? 你可以用select * from tablename where rownum between 10 and 20; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from (select rownum id,a.* from tablename a order by ...) bwhere b.id between 10 and 20; rownum!select *from tablewhere rownumorder by field. to snowy_howe(天下有雪) 这种方法是不是最优的办法?这样实际上是搜索出实际的条数(比如5万条),再从中取了几条。速度和搜索五万条记录一样。 to : buddyxue(薛训明) 你可以用select * from tablename where rownum between 10 and 20;单纯的rownum似乎是不行的,你可以试试. select * from (select rownum id,tbname.* from tbname where rownum<=20) awhere a.id>=10; select * from (select rownum id,tbname.* from tbname where rownum<=20) awhere a.id>=10; 这个问题,你看看这个,讨论的比较详细了:http://www.cnoug.org/bin/ut/threaded_show.cgi?tid=38&h=1&bpg=1&age=0 你可以分段统计,如根据表中某一字段id,然后累计所得结果select count(*) from tbname where id<100000select count(*) from tbname where id>=100000 and id<1000000...select count(*) from tbname where id>10000000 结贴,请看 tuidler() 推荐的:http://www.cnoug.org/bin/ut/threaded_show.cgi?tid=38&h=1&bpg=1&age=0 linux下oracle所需软件包的问题 将ORACLE数据库设为只读? 求助:dmp转sql 求集合数据SQL文的写法,简单表。 问个关于ORACLE日志分析的问题 求一句数据库统计的SQL语句~跪求 有没有函数可以实现时间按周增加的效果? 数据库连接问题?? 想做一个分页的程序,如何获得数据库m行到n行的数据 为什么我的SQLPlus WorkSheet有时不好用? 如何在同一语句中操作2个链路?? 怎么不能删除数据?
where b.id between 10 and 20;
from table
where rownum
order by field.
这种方法是不是最优的办法?
这样实际上是搜索出实际的条数(比如5万条),再从中取了几条。速度和搜索五万条记录一样。
where a.id>=10;
where a.id>=10;
http://www.cnoug.org/bin/ut/threaded_show.cgi?tid=38&h=1&bpg=1&age=0
select count(*) from tbname where id<100000select count(*) from tbname where id>=100000 and id<1000000
.
.
.
select count(*) from tbname where id>10000000
http://www.cnoug.org/bin/ut/threaded_show.cgi?tid=38&h=1&bpg=1&age=0