CREATE TEMPORARY TABLE A(KEY_DEGREE INTEGER, KEY_EXECUTION_YEAR INTEGER) select DCP.KEY_DEGREE,  MIN(EG.KEY_EXECUTION_YEAR) AS KEY_EXECUTION_YEAR FROM EXECUTION_DEGREE EG, DEGREE_CURRICULAR_PLAN DCP WHERE EG.KEY_DEGREE_CURRICULAR_PLAN=DCP.ID_INTERNAL GROUP BY DCP.KEY_DEGREE;

update DEGREE_INFO DI, A set DI.KEY_EXECUTION_YEAR=A.KEY_EXECUTION_YEAR WHERE DI.KEY_EXECUTION_YEAR=1000;

drop temporary table A;


