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

前端 未结 4 722
萌比男神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:53

    An alternative way:

    SELECT ...
    FROM bla
    WHERE finalDate = (SELECT MAX(finalDate) FROM bla) AND
          rownum = 1
    

提交回复
热议问题