Please bear with me as I am new to all this.
can someone assist me in figuring out the most appropriate method to obtain the most recently entered "NOTES" against the corresponding ORDER_NUMBER
I've used the below code. However this will only give the first entry made on "NOTES"
Is there a more efficient method of obtaining the most recent entry made under "NOTES" without having to change the
Reason is that an ORDER_NUMBER can have multiple ORDER_LINES and each line will have "NOTES" entered against it depending on the updates entered by the users. So when the report is executed the ORDER_NUMBER and corresponding ORDER_LINE should only show the most recently entered "NOTE_PAD"."NOTES"
Would really appreciate any assistance, as I have been trying to look for some answers online, but not been very lucky
FROM ( SELECT ORDER_DETAIL.CREATED_DATE,
NOTE_PAD.CREATED_DATE AS NOTE_DATE,
ROW_NUMBER ( ) OVER ( PARTITION BY ORDER_DETAIL.ORDER_NUMBER,
ORDER BY ORDER_DETAIL.CREATED_DATE DESC ) AS SEQNUM
WHERE ( "ORDER_DETAIL"."ORDER_NUMBER" = "ORDER_HEADER"."ORDER_NUMBER" )
AND ( "ORDER_HEADER"."ORDER_NUMBER" = "ORDER_AWB"."ORDER_NUMBER" )
AND ( "ORDER_AWB"."NOTES" = "NOTE_PAD"."NOTES" ( + ) ) )
WHERE ORDER_NUMBER = '991428'
AND ROWNUM <= 1
The result I need is as below, the "NOTES_TEXT" column needs to show the most recently entered data and not all the values entered. If there is no value entered then it should show blank as see here;