oracle查詢50到80行數(shù)據(jù) oracle查詢?cè)趺床樵兡硹l數(shù)據(jù)在第幾行?
oracle查詢?cè)趺床樵兡硹l數(shù)據(jù)在第幾行?select t.*,rownum rn from table1 t --rownum就是記錄所在的行數(shù)你是指定ID去查詢,得到的記錄只有一條,所以ro
oracle查詢?cè)趺床樵兡硹l數(shù)據(jù)在第幾行?
select t.*,rownum rn from table1 t --rownum就是記錄所在的行數(shù)你是指定ID去查詢,得到的記錄只有一條,所以rownum始終是1了,你想要的結(jié)果應(yīng)該是select tt.*,tt.rn from (select t.*,row_number() over (order by id) rn from table1 t ) tt where tt.id = 你要查詢的ID值