I hope is phrased my question properly.
I have a pre-existing table called CUSTOMERS, that has columns CustomerID and Last_Order_Date. I want to update each Customer_ID with their last order date from another table (Orders):
SET Last_Order_Date = Last_Order
WHERE Customer_ID IN
( SELECT Customer_ID, MAX(Order_Date) AS Last_Order
GROUP BY Customer_ID )
Can you help fix what I have above to make it work? thank you.