Hi,
I have this functionCREATE OR REPLACE FUNCTION sumlast_func()
RETURNS trigger AS
begin
CASE
WHEN idcar = (select idcar FROM selectedcar) THEN
JOIN selectedcar ON selectedcar.idcar = actuals.idcar)
update actuals
set
comb = comb + (select combor from combor_view
where idlog = (select max(idlog) from combor_view)),
END CASE;
return new;
end
CREATE TRIGGER update_actuals_tg
AFTER INSERT
ON combor
FOR EACH ROW
EXECUTE PROCEDURE sumlast_func();