insert into SS_ROLE_OPERATION(ROLE_ID, OPERATION_ID) select id, (select max(id) from SS_OPERATION where operationId = 'SSTS_DepartForAllList_Select') from SS_ROLES where exists (select id from SS_OPERATION where operationId='SSTS_DepartForAllList_Select') and id not in (select ROLE_ID from SS_ROLE_OPERATION where OPERATION_ID = (select max(id) from SS_OPERATION where operationId = 'SSTS_DepartForAllList_Select'));