oracle查詢50到80行數(shù)據(jù) oracle查詢怎么查詢某條數(shù)據(jù)在第幾行?
oracle查詢怎么查詢某條數(shù)據(jù)在第幾行?select t.*,rownum rn from table1 t --rownum就是記錄所在的行數(shù)你是指定ID去查詢,得到的記錄只有一條,所以ro
oracle查詢怎么查詢某條數(shù)據(jù)在第幾行?
select t.*,rownum rn from table1 t --rownum就是記錄所在的行數(shù)你是指定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值