I execute the following query in postgres:
UPDATE products SET dealer_id =
CASE
WHEN order_id = 7 THEN '1'
WHEN order_id = 6 THEN '2'
ELSE dealer_id
END
RETURNING id
I expect to get ids of the updated rows like [3,4,5] but it returns all rows ids
what's wrong with my query?
WHERE order_id in (6, 7)
, to avoid updating all rows. – Muster