Help create a trigger, I do not understand what the error is ....
DELIMITER // CREATE TRIGGER trInsRaboty AFTER INSERT ON Raboty FOR EACH ROW BEGIN SET AUTOCOMMIT=0; START TRANSACTION; IF (select count(*) from Raboty where (IdRabot = new.IdRabot))<VidyRabot.KolvoSotrudnikov then (Insert raboty values(null,new.IdVidaRabot,new.IdSotrudnika,new.DataNach,(select Dni_NaVypolnenie from VidyRabot where idVidaRabot=new.IdVidaRabot)+new.DataNach);); Else ROLLBACK; EndIF; COMMIT; END; // DELIMITER ; COMMIT; END; // DELIMITER ;
Added from comment.
No, it looks like a line by line (through the console I work) an error like
ERROR 1064 (42000): 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 'select IdSotrudnika from Raboty where (IdRabot = new.IdRabot))<VidyRabot.KolvoSo' at line 5