Oracle ROWNUM, paging, 三层嵌套,分页

博客介绍了Oracle中ROWNUM的相关知识。ROWNUM是序列数生成器,从1开始,为所选每行分配序号。使用“ROWNUM > 1”无法获取行,因为不能从2开始分配;而“ROWNUM >=1”可选中所有行。涉及ROWNUM的条件应从1开始分配序号,否则失败。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

迄今为止网上见到的能让我很好理解ROWNUM的一段话:
Oracle's ROWNUM is a sequence number generator. It always starts with 1. The sequence numbers are assigned to each row as they are selected. So when you say "ROWNUM > 1" , you are implicitly asking oracle to assign rownumbers starting from 2, which it cannot do and so you wouldn't get any rows. For testing, try "ROWNUM >=1" where you are asking the rownum to be assigned from 1 and all the rows will get selected.

Summary: Any condition which involves "ROWNUM" should ask Oracle to start assigning rownumbers starting from "1". All other conditions fail.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值