oracle里的rownum的使用。
select * from (select rownum num,student_name from student) where num >10;
这样取也来的东西并不是前10条。
取前10条应该怎么写啊,求教高手。
select * from (select rownum num,student_name from student) where num >10;
这样取也来的东西并不是前10条。
取前10条应该怎么写啊,求教高手。
解决方案 »
- plsql连接oracle11G出现ORA-12154: TNS: 无法解析指定的连接标识符
- oracle中的update语句更新多个字段问题
- 三张表的关联问题
- 表 KSOURCE.USERINFO 发生了变化, 触发器/函数不能读它
- orale里是否有处理时间间隔的函数??
- 请问大型零售商业系统使用哪种数据库较好?DB2、Sybase还是Oracle?
- C#操作Oracle数据
- 如何用like实现如windows操作系统中?的查询效应
- 小弟想学ORACLE,哪位大侠有ORACLE8I或ORACLE9I的盘提供下载呀?(for nt or 2000)
- oracle中连接两个字符串是怎么写的?
- C#+Oracle的PROCEDURE传递BLOB数组的问题,传递字符串数组本人会。
- 问用sql如何查询2个有联系的表
where rownum<=10 //前10条
你写的是从10条到结束
select * from tbl where rownum < =1011-20
select * from (select a.*, rownum rn from tbl where rownum <=20) where rn >=11
例子
-- 成功输出之后才会加1
Select * from t where rownum = 2Rownum = 1
For x in ( select * from t )
Loop
if ( rownum = 2 )
then
output record
rownum = rownum+1;
end if
End loop
这样永远执行不到
CURSOR c1 IS SELECT empno, sal FROM emp
WHERE sal > 2000 AND ROWNUM < 10; -- returns 10 rowsThe value of ROWNUM increases only when a row is retrieved, so the only meaningful uses of ROWNUM in a WHERE clause are... WHERE ROWNUM < constant;
... WHERE ROWNUM <= constant;