How about an update self-join? update ads a set img_1_small = b.img_1_small from ads b left outer join ads a on a.id = b.id where a.img_1_small is NULL