I need to update my column with trigger automaticly.
Here is code:
create trigger sum update on `cash`
for each row
begin
UPDATE `cash`
SET `sum_cash` = `cash` + `sum_cash`;
end;
$$
And I got following error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update on `cash` for each row begin UPDATE cash` SE' at line 1
I work on MySQL.
Try this:
You missed the
afterorbeforekeyword. Also I changed trigger name sincesumis a keyword.