select concat('UPDATE STUDENT_GROUP set STUDENT_GROUP.KEY_GROUPING = ', 
       ATTENDS_SET.KEY_GROUP_PROPERTIES, 
       ' where STUDENT_GROUP.KEY_ATTENDS_SET = ', 
       ATTENDS_SET.ID_INTERNAL, ';') 
as "" from ATTENDS_SET;

