select concat('UPDATE ACCOUNTING_TRANSACTION set KEY_TRANSACTION_DETAIL = ', ID_INTERNAL , ' where ID_INTERNAL = ', KEY_TRANSACTION, ';') as "" from ACCOUNTING_TRANSACTION_DETAIL;