select score,id from
(select a.*,rownum rn from
(select score,id from HISTORY where id='149' order by testdate desc) a)
where rn=2
(select a.*,rownum rn from
(select score,id from HISTORY where id='149' order by testdate desc) a)
where rn=2
调试欢乐多
select a.*,rownum rn from
(
select rownum lineid,score,id from HISTORY where id='149' order by testdate desc
)
order by lineid
)
where rn =2
select score,id from HISTORY where id='149' order by testdate desc
) a where rownum=2
select a.*,rownum rn from
(
select rownum lineid,score,id from HISTORY where id='149' order by lineid
)
)
where rn =2
select * from (
select a.*,rank() over(order by a.testdate desc) rk from table a
)
where rk=3
From (Select Rownum Num, a.* From (Select * From table Order By testdate) a)
Where Num = 1
select a.*,row_number() over(order by a.wellno desc) rk from c_well a
)
where rk=2
over()是一个关键字,用于标示分析函数。