insert into comp_control_acct_setup (refID, groupDisplay, companyID, accountCode,accountID, orderNo,createdby)  select ID, groupDisplay, 90,name, (select id from comp_chart_of_acct where companyid=90 and acctcode=_ref_control_acct_setup.defaultAcctCode) as accountID, orderNo,1 from _ref_control_acct_setup where name not in (select accountCode from comp_control_acct_setup where companyID = 90) 