UPDATE `tblpost_inspections` SET `property_id`= (SELECT property_id from tblestimates where tblestimates.id = tblpost_inspections.estimate_id) where estimate_id > 0 and (property_id = 0 OR property_id is null);