Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Recuperar a linha mais recente - pré-Oracle 12c


Para um Oracle DB pré 12c, isso deve funcionar
SELECT * FROM
  (
  SELECT ORDER_TYPE,
         ORDER_NUMBER,
         ORDER_LINE,
         NOTE_PAD.CREATED_DATE
  FROM ORDER_AWB INNER JOIN
         NOTE_PAD ON ( "ORDER_AWB"."NOTES" = "NOTE_PAD"."NOTES" )
  WHERE ( "ORDER_AWB"."ORDER_NUMBER" = '867318' )
  ORDER BY NOTE_PAD.CREATED_DATE DESC
  )
WHERE ROWNUM <= 1