Oracle
 sql >> Database >  >> RDS >> Oracle

Recupera la riga più recente - precedente a Oracle 12c

Per un DB Oracle pre 12c questo dovrebbe funzionare

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