sql >> Base de Datos >  >> RDS >> Oracle

Recuperar la fila más reciente:anterior a Oracle 12c

Para Oracle DB anterior a 12c, esto debería 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