update T_BCM_StructOfAccount_S a set fentryrate = (select fexchange from T_BCM_StructOfAccount b where b.fid = a.fid) WHERE exists (select 1 from T_BCM_StructOfAccount b where b.fid = a.fid);
insert into T_BCM_StructOfAccount_S(fid,fentryrate) select fid,fexchange as fentryrate from T_BCM_StructOfAccount a where not exists (select 1 from T_BCM_StructOfAccount_S s where a.fid=s.fid);
update T_BCM_StructOfAccount_S set fentryrate = '1' where fentryrate not in(' ', '1', '2', '3', '5');