1、创建一个student,并且插入数据
create table student(name varchar(12),age int) insert into student values('z1','');
insert into student values('z2','');
insert into student values('z3','');
insert into student values('z4','');
insert into student values('z5','');
commit;
2、直接按照age进行排序显示行号:
select * from(select rownum rw,t.* from student t order by t.age asc)
3另一种查询,能够很好地查找:
select row_number() over( order by t.age asc) rw,t.* from student t