补充一下: select id,name,address from tableName where ... and rownum>20 and rownum<30 只检索第21-30条记录
为什么我用你这种方法没有用呀,从rownum>0 and rownum<10可以的,但用rownum>10 and rownum<20就没有用。这是为什么。(补充一下: select id,name,address from tableName where ... and rownum>20 and rownum<30 只检索第21-30条记录)
rownum要从1开始计数,不能直接用于>或者=某个大于1的数 try: select ... from (select rownum rid,id,name,address from tableName where ... and rid<30) where and rid>20;
http://www.51blog.net/artCatolog.asp?classID=6
其次可以将得到的数据先在程序中做处理. 比如说先显示多少记录等等.这样会感觉快点.还有就是你的网络和硬件.
要看看有没有利用上index。等等。
比如分页显示20条,那么只查前20条
只检索第21-30条记录
只检索第21-30条记录)
try:
select ... from (select rownum rid,id,name,address from tableName where ... and rid<30) where and rid>20;