UPDATE CAREGART SET EXITOT=(SELECT SUM(A.EXIACT) FROM CAARTALMUBI A WHERE A.CODART=CAREGART.CODART GROUP BY A.CODART) FROM CAARTALMUBI X WHERE CAREGART.CODART=X.CODART