insert into comp_control_acct_setup (refID, companyID, accountCode,orderNo,createdby)  select ID,84,name,orderNo,1 from master_code where masterID = 21 and name not in (select accountCode from comp_control_acct_setup where companyID = 84) 