we have a table that includes several prices for each item. for example see below table.
we would like a query to show us only the last price by date for each productPartID.
how do we do that?
RequestNumber ProductPartID ProductName Quantity OrderNumber Price OrderDate 1 B45114 120 - BLK 45 1 1/4"(20/40) 1000 519189 0.92 11/7/2016 1 B45114 120 - BLK 45 1 1/4"(20/40) 1000 519320 0.79 12/9/2016 1 B4512 120 - BLK 45 1/2"(50/200) 100 519189 0.25 11/7/2016 1 B4512 120 - BLK 45 1/2"(50/200) 100 750691 0.22 12/9/2016 1 B4512 120 - BLK 45 1/2"(50/200) 100 519320 0.22 12/9/2016
for example B45114 we want to see only OrderNumber 519320 with price 0.79 because it is has the most recent price for this item.