我用了一种方法,但是速度太慢,求各位大侠给个效率高的SQL语句,或者优化一下。谢谢!"select * from (select * from Code_Standard where CODE_STRING Like '2105%' and Rule_ID=4) where rownum < 21 minus select * from ( select * from Code_Standard where CODE_STRING Like '2105%' and Rule_ID=4) where rownum < 0"
解决方案 »
- 如何生成一个有格式的流水号
- plsql 基础问题
- oracle字符集问题(us7ascii 转 zhs16gbk)
- Oracle安装的时候的一个问题?
- instance sid has been terminated!!!!!!!
- 为什么PROC 编译出来的程序那么大 ?有8M 阿 ?有办法缩小字节吗 ?(源程序不大)
- 如何在ORACLE中存储JPEG图像
- Oracle ODBC的连接问题
- 为什么我第一次登陆Oracle Management server可以登陆,但是重新启动以后就连不上了呢?
- 急!急!急!delphi 6 通过 odbc 访问 oracle 7 出现问题?
- 新手请教:如何close cursor, 用sqlj写的程序!!在线等
- 如何用。NET2005访问ORACLE?急,在线等!!!
select last_name,salary from employees order by nvl(salary,0) desc)) e
where r between 6 and 10;
select * from (select rownum as rid, CODE_STANDARD.* from (Select * from CODE_STANDARD Where RULE_ID=4 ) where rownum >0) where rid< 50 我想返回CODE_STANDARD表中的所有字段,但是CODE_STANDARD.* 这里报错,谁帮我改一下吗?
a.num
from
(
select col,
row_number() over(order by col) num
from tab
) a
where a.num >10
and a.num < 20
select * from
(
select * from Code_Standard where CODE_STRING Like '2105%' and Rule_ID=4 and rownum<21 minus select * from Code_Standard where CODE_STRING Like '2105%' and Rule_ID=4 and rownum<0
)
试试这个
with Code_Standard_tmp as (select rownum sn,u.* from Code_Standard u )
select * from Code_Standard_tmp where sn between 10 and 20当然还有别的方法,但我目前测试这种方法的速度最快。
with Code_Standard_tmp as (select rownum sn,u.* from (select * from Code_Standard order by 排序字段) u)
select * from Code_Standard_tmp where sn between 10 and 20
with Code_Standard_tmp as (select rownum sn,u.* from (select * from Code_Standard order by 排序字段) u)
select * from Code_Standard_tmp where sn between 10 and 20
with Code_Standard_tmp as (select rownum sn,u.* from (select * from Code_Standard order by 排序字段) u)
select * from Code_Standard_tmp where sn between 10 and 20