oracle限定返回结果集的行数
2013-10-11 20:26
281 查看
在mysql中,可以通过limit限制返回结果集的行数,如:
返回了user_table的前两行,在oracle中没有limit,如果oracle要得到同样的结果,则:
这里rownum是内置关键字,表示结果集的行号,但是不能对rownum进行复合条件判断,如果要返回第11行至第20行10条数据,不能这样写:
而是应该写成结果集相减的形式:
select * from user_table limit 2;
返回了user_table的前两行,在oracle中没有limit,如果oracle要得到同样的结果,则:
select * from user_table where rownum < 3;
这里rownum是内置关键字,表示结果集的行号,但是不能对rownum进行复合条件判断,如果要返回第11行至第20行10条数据,不能这样写:
select * from user_table where rownum > 10 and rownum < 21;
而是应该写成结果集相减的形式:
select * from user_table where rownum < 21 minus select * from user_table where rownum < 11;
相关文章推荐
- Oracle 限定返回的结果集 -- ROWNUM
- Oracle 限定返回的结果集 -- ROW_NUMBER
- 关于Oracle、Mysql、SQLServer中指定查询结果中返回的行数问题!
- Oracle中返回结果集的存储过程分享
- oracle创建存储过程并返回结果集(附C#调用代码)
- 最完整的:JAVA调用ORACLE的存储过程、函数的返回结果集例子
- IBatis调用ORACLE的存储过程、函数的返回结果集例子
- Oracle和My Sql返回结果集的存储过程
- Oracle带输入、输出参数的存储过程 返回受影响的行数 SQL%ROWCOUNT
- oracle 游标 返回结果集 例子
- 利用游标返回结果集的的例子(Oracle 存储过程)
- Oracle中返回结果集的存储过程(转帖 网摘)
- Oracle 执行计划(2)-基数 cardinality【即估算一个操作返回的行数】
- MySQL、Oracle、MS SQLserver限制查询所返回的行数
- db2,oracle,mysql ,sqlserver限制返回的行数
- Oracle利用存储过程返回结果集开发报表 推荐
- oracle:ORACLE 实际返回的行数超出请求的行数
- Oracle Procedure 返回结果集和exists使用 (不积跬步,无以至千里)
- C++使用ADO访问Oracle返回结果集(REF CURSOR)存储过程
- Oracle 返回结果集的 存储过程