oracle rownum的用法

  • 使用rownum(rownum表示伪劣,实际并不存在,是在查询结果集之后加上去的)查询某行结果集简述

在使用rownum的时候只能用 '<'或‘<=’,如果要使用‘>’或‘>=’的时候,必须使用别名(别名的重要性),mysql数据库是不能识别rownum的,只在oracle中有效

前10行:select * from product where  rownum<=10;

10行后:select * from (select e.*,rownum rn from product e) where rn>=10;

10-20行:select * from (select e.*,rownum rn from product e) where rn between 10 and 20;

猜你喜欢

转载自blog.csdn.net/Roriring/article/details/88296548