oracle查询怎么查询某条数据在第几行?
select t.*,rownum rn from table1 t --rownum就是记录所在的行数你是指定ID去查询,得到的记录只有一条,所以rownum始终是1了,你想要的结果应该是select tt.*,tt.rn from (select t.*,row_number() over (order by id) rn from table1 t ) tt where tt.id = 你要查询的ID值