Item Number | Customer | Creation Date | Onhand Qty
123 1 03-FEB-19 654
234 3 03-FEB-19 987
789 5 03-FEB-19 874
321 4 03-FEB-19 147
567 7 03-FEB-19 632
123 1 29-JAN-19 547
234 3 29-JAN-19 814
789 5 29-JAN-19 458
321 4 29-JAN-19 330
567 7 29-JAN-19 118
I have this data set above, but for thousands of items and hundreds of customers.
What I'd like to do is to just return the latest 'Onhand Qty' field, so max(creation_date) but by item and customer.
Item Number | Customer | Creation Date | Onhand Qty
123 1 03-FEB-19 654
234 3 03-FEB-19 987
789 5 03-FEB-19 874
321 4 03-FEB-19 147
567 7 03-FEB-19 632
Effectively, I'm trying to find the most recent onhand qty amount, by customer and item, so I can say that at the most recent check, 'Customer 1 had 654 units of Item 123'.
Is someone able to help me?
This is in an Oracle database (V11).
Many thanks