So i have learned somhing abou triggers in mysql..While i as using selct statement inside the trigger it throws me error ..So after some research i have seen that using select statement and inserting into a variable can be done in trigger..So the code which i have used is
CREATE TRIGGER ins_sum AFTER UPDATE ON foo
FOR EACH ROW
declare some int;
select a from foo into some;
UPDATE foo SET a = 3 WHERE b = 1;
But it throws me error like Schema Creation Failed: 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 'declare some int'
Why is it like this ??..Any help would be apreciated..Thanx