社区
基础和管理
帖子详情
select * from (select *,rownum rn from A ) where rn>=1 and rn<=10
jackeyhlj
2011-02-23 11:29:17
select * from (select *,rownum rn from A ) where rn>=1 and rn<=10
这样写有什么错
...全文
756
11
打赏
收藏
select * from (select *,rownum rn from A ) where rn>=1 and rn<=10
select * from (select *,rownum rn from A ) where rn>=1 and rn<=10 这样写有什么错
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
11 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
sedd4444
2011-03-02
打赏
举报
回复
直接在Rownum >=1 and Rownum<=10 不就OK拉,你又没排序什么的
luoyoumou
2011-02-23
打赏
举报
回复
-- 要不就这样:(给表加个别名)
select rownum, e.* from emp e;
luoyoumou
2011-02-23
打赏
举报
回复
scott@SZTYORA> select *, rownum rn from emp;
select *, rownum rn from emp
*
第 1 行出现错误:
ORA-00923: 未找到要求的 FROM 关键字
-- 当指定 rownum时,其他字段,不能用*,必须一一列出!(楼主:别偷懒,好不?)
minitoy
2011-02-23
打赏
举报
回复
select * from (select a.*,rownum rn from A ) where rn>=1 and rn<=10
*号前加上表名
minitoy
2011-02-23
打赏
举报
回复
没错误
cuicuidonghua
2011-02-23
打赏
举报
回复
select * from (select t1.*,rownum rn from (select * from emp) t1 where rownum<=10) where rn>=1; 这条肯定没错咯
minitoy
2011-02-23
打赏
举报
回复
呵呵,没排序的分页语句是看着不爽[Quote=引用 7 楼 cuicuidonghua 的回复:]
怎么看这条分页语句。。。 怎么别扭。。。
[/Quote]
cuicuidonghua
2011-02-23
打赏
举报
回复
怎么看这条分页语句。。。 怎么别扭。。。
smzen
2011-02-23
打赏
举报
回复
[Quote=引用 1 楼 minitoy 的回复:]
[/Quote]
同二楼
wht8008
2011-02-23
打赏
举报
回复
2L是最佳答案。
oracle分页操作
ROW
NUM
<= 40和
RN
>= 21控制分页查询的每页的范围。 上面给出的这个分页查询语句,在大多数情况拥有较高的效率。分页的目的就是控制输出结果集大小,将结果尽快的返回。在上面的分页查询语句中,这种考虑主要体现在...
oracle 分页语句
select
* from (
select
a.*,
row
num
rn
from (
select
* from tablename) a where
row
num
<=
10
) where
rn
>2
oracle分页
from (
select
t1.*,
row
num
rn
from (
select
* from 表名) t1 where
row
num
where
rn
>=小范围(从第几条数据开始取); 特别说明: oracle 分页查询是通过三层筛选法进行查询的。每一次都可以带 where ...
select
* from (
select
P.*,
ROW
NUM
RN
FROM(
select
* from Mp_Relatedart where pubbaseid=785 order by ID...
select
* from (
select
P.*,
ROW
NUM
RN
FROM(
select
* from Mp_Relatedart where pubbaseid=785 order by ID ASC )P)M WHERE M.
RN
>2 and M.
RN
<= 7 转载于:https://www.cnblogs.com/laijie/p/4800251.html
oracle分页,
row
num
的使用与理解
select
* from student where
row
num
<
10
或
select
* from student where
row
num
!=
10
where + (
row
num
表达式)
row
num
=1,表达式结果为true,结果集保存该条数据,比较下一条,此时
row
num
++,变为2;
select
* ...
基础和管理
17,377
社区成员
95,128
社区内容
发帖
与我相关
我的任务
基础和管理
Oracle 基础和管理
复制链接
扫一扫
分享
社区描述
Oracle 基础和管理
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章