update table_a set apname=(select max(name) from person
where id=table_a.apid)
where apid in(select id from person)
and (apname='' or apname is null);
update table_a set apname=(select max(name) from person
where id=table_a.apid)
where apid in(select id from person)
and (apname='' or apname is null);