I have some data, and wherever the server_id, product_id, and polled_at date match, i want to set updated_by to 2 (only searching rows where updated by is already 1). I have been messing with my code for a while, but can't figure it out. Please help me. here is what I have.
http://sqlfiddle.com/#!2/ebd112/1
The first 2 rows should not get updated, and only the max peak between all other rows where the server_id, product_id, and polled_at match up, should be updated to updated_by=2
Thanks