为什么rownum>10 and rownum<20 不能用
而rownum as aaa 以后, aaa>10 and aaa<20可以用呢!
而rownum as aaa 以后, aaa>10 and aaa<20可以用呢!
解决方案 »
- 数据库设计的时候,能否允许存在关系为一对一的表格?
- ORA中如何锁定行数据
- oracle中将11,22,33,44,...,..,..,不定长度的字符串和中找到逗号(,),并截去出来。
- oracle 的全文索引与普通索引只能被使用其中一个吗
- JDBC连接oracle的问题!
- 求解一道OCA试题
- 在oracle10中,能通过浏览器对已经建好的表直接插入数据吗?
- oracle中怎样同时执行多条SQL语句
- 为什么Oracle书上的SQL都没有schema?
- 如何创建一个非空的自动加一的字段(在线等待,解决即结贴)
- 问UTF8编码方式使用几个字节存放汉字,
- 谁用过ORACLE 中的PROC*C/C++预编译器,进来一下。。。。
select * from (select rownum as rn,wybsm from zh_sbtyjbda)
where rn>10 and rn<20我想应该是与rownum是伪列有关系,经过改写后rownum不是作为伪列处理的
WHERE ROWNUM > 1;
The first row fetched is assigned a ROWNUM of 1 and makes the condition false. The
second row to be fetched is now the first row and is also assigned a ROWNUM of 1
and makes the condition false. All rows subsequently fail to satisfy the condition, so
no rows are returned.
所以不能select * from tablename where rownum > 2,因为选出一个记录后rownum=1,然后去判断where条件,不满足,则退出。