I need to return a record of each prod_numb and the cost_amt based on the most recent sale_date column.
Basically I need something like this:
SELECT prod_numb
, cost_amt
FROM product_cost
WHERE MAX(sale_date)
I know this will not run, but its best way to describe it. Can someone help with this query?
Array
(
[0] => Array
(
[prod_numb] => 2336
[cost_amt] => 32.00
[sale_date] => 2015-01-01
)
[1] => Array
(
[prod_numb] => 2336
[cost_amt] => 32.00
[sale_date] => 2015-01-02
)
[2] => Array
(
[prod_numb] => 2458
[cost_amt] => 32.00
[sale_date] => 2015-01-03
)