Oracle-rownum

code

select a.* from T_USER a where rownum<2
-- rownum从1开始,上面就查出第一行
-- rownum是一行进行赋值的,如果要从排序中获取,我们必须使用子查询查询之后在使用rownum进行查询
select a.* from T_USER a where rownum>1
-- 上述会返回null,感觉会有也,很神奇呀
select * from (
select a.* from T_USER a
where rownum<5
)
 where rownum>1
--  这么查没有
-- 但是将伪列rownum 作为一列返回后使用where条件进行比较就可以查出
select * from (
select a.*,rownum as rn from T_USER a
where rownum<5
)
 where rn>1

printscreen

Oracle-rownum

相关文章:

  • 2022-01-07
  • 2021-09-07
  • 2022-02-10
  • 2022-02-10
  • 2022-02-10
  • 2022-03-09
  • 2021-08-20
  • 2022-12-23
猜你喜欢
  • 2022-02-10
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2021-09-26
  • 2022-01-07
相关资源
相似解决方案