Oracle分页SQL

查询所有及rownum时需要在rownum之前的*必须使用表的名称country.*

select * from (select country.*,rownum rn from country where rownum < 9) a where rn > 2

分页查询示例

select a.*,rownum as rn from (select * from country where rownum < 9) a where rn > 2 
-- ORA-00904: "RN": invalid identifier (rn不是a表的列) select * from (select a.*,rownum rn from (select * from country where rownum < 9) a ) where rn > 2

 

 

posted @ 2019-09-23 15:47  浮生半瓶醋  阅读(105)  评论(0编辑  收藏  举报