DELETE FROM t_lic_licensedetail WHERE fid NOT IN (SELECT fid FROM t_lic_license);
update t_lic_licensedetail ld set FBEGINDATE = (select FACTIVEDATE from t_lic_license l where l.fid = ld.fid) where FBEGINDATE is null;
update t_lic_licensedetail ld set FENDDATE = (select FexpDATE from t_lic_license l where l.fid = ld.fid) where FENDDATE is null;