insert into comp_form_control (companyID, formID, formCode,createdby, orderno)
select 81, id, code, 1, orderno from master_code
where masterid=18 and id not in (select formid from comp_form_control where companyid=81)