update acc_trans set tax_chart_id = (select id from chart where accno = substr(acc_trans.tax,1,4)) where tax <> '' and tax <> 'auto';