2 thoughts on “PL/SQL: How to query 2nd record only if sorted by date?”

  1. select a. * from (select s. *,max(rn) over() maxr from (select TABLE. *,rownum rn from TAB1 order by rownum desc) s ) a where maxr-1=rn;Replace TABLE with the desired table name.

Leave a Reply

Your email address will not be published. Required fields are marked *