How can I get just the first row in a result set AFTER ordering?

前端 未结 4 574
萌比男神i
萌比男神i 2021-01-04 00:38

This gives me just one row (the first one):

SELECT BLA
FROM BLA
WHERE BLA
AND ROWNUM < 2

However, I want the most recent date val; I can

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 00:58

    In 12c, here's the new way:

    select bla
      from bla
     where bla
     order by finaldate desc
     fetch first 1 rows only; 
    

    How nice is that!

提交回复
热议问题