update tax_master a, _ref_tax_master b set a.taxAccount = (select id from comp_chart_of_acct where companyid=102 and acctcode= b.defaultTaxAccount) where a.code = b.code and a.companyid=102 and a.taxAccount is null