select concat('update ACCOUNTING_EVENT set KEY_ADMINISTRATIVE_OFFICE= ',ID_INTERNAL,' WHERE KEY_ADMINISTRATIVE_OFFICE IS NULL;') as "" 
from ADMINISTRATIVE_OFFICE WHERE ADMINISTRATIVE_OFFICE_TYPE ='MASTER_DEGREE';