I am trying to update a table as a trigger is called and I am getting a syntax error on the update statement.
BODY OF TRIGGER:
set @diff = old.amount -new.amount;
UPDATE decks
SET decktotal = decktotal + @diff
WHERE deckname = old.deckname;
I will add more information if needed but I imagine this to be a particularity stupid oversight on my part that is easily rectified. Thanks for lookin either way!
EDIT: ERROR 1064 error in syntax at
UPDATE decks
SET decktotal = decktotal + @diff
FROM old
WHERE deckname = old.deckname;
declare @diff moneyperhaps?