UPDATE person p,house h,village v SET p.house_regist_type_id=4 WHERE p.house_id=h.house_id AND h.village_id=v.village_id AND village_moo =0