I'm trying to get to last four prices we've payed for a sub-set of parts. I'm able to get the last four prices we've payed for a particular part but I want to exted it to all parts. the current query I have is:
I just need to get rid of the where clause in the inline view and I would have the result I need. Is there any way to do this?
Code:
SELECT HIST.*, ROWNUM
FROM (SELECT APD.Part_Number,
APD.Actual_Unit_Price
FROM AP_DETAIL APD
WHERE APD.Part_Number = 'XXXXXXXXXX'
ORDER BY APD.Entered_Date DESC) HIST
WHERE ROWNUM <= 4
Comment