There are 2 tables : Sales & Transaction. I need to update the INDICATOR column of the Sales table using CASE WHEN by joining these two tables in Netezza database.
Using below query but not working. Error - Update canceled: attempt to update a target row with values from multiple join rows
Update Sales s
SET indicator =
CASE
WHEN t.retail >= s.PRICe then 'Y'
WHEN t.retail < s.PRICE then 'N'
ELSE NULL END
FROM TRANSACTION t
WHERE s.id = t.id and s.STORE_ID = t.store_id;