ROWNUM与row_number()函数的区别与应用

rownum伪字段只能筛选条件包含1:

select * from STUDENTS t 

where rownum<=10

row_number()函数可以根据自己的需求任意筛选:

select * from
(select s.*,
row_number() over(order by id desc) as rn
from students s )
where rn between 5 and 8

posted @ 2020-12-30 16:11  广东赖  阅读(152)  评论(0编辑  收藏  举报