oracle取前三條數(shù)據(jù) oracle取最后一條數(shù)據(jù)?
oracle取最后一條數(shù)據(jù)?查詢Oracle表中最后一行數(shù)據(jù)(行順序與DATE字段無關(guān)):select * from (select * from TABLE order by rownum) whe
oracle取最后一條數(shù)據(jù)?
查詢Oracle表中最后一行數(shù)據(jù)(行順序與DATE字段無關(guān)):
select * from (select * from TABLE order by rownum) where rownum
查詢Oracle表中最后一行數(shù)據(jù)(行順序與DATE字段有關(guān)):
select * from (select t.* from TABLE t order by t.DATE) where rownum
oracle中只讀取一條數(shù)據(jù),怎么寫?
select*fromtestwhererownum=1可以取到第一條,但你能這樣用:select*fromtestwhererownum=2不能說我直接取第二條。select*fromtestwhererownum<=5你也可以這樣用,取前5條。rownum只能是連續(xù)的,而且必須是從1開始的最常用的用法如下:select*from(selectrownumr,*fromtest)ttwherett.r>0andtt.r<=3這樣你就可以取任意的位置的記錄了。比如我想取第二條:select*from(selectrownumr,*fromtest)ttwherett.r=2