CREATE TRIGGER `Delivery` AFTER INSERT ON `pending`
FOR EACH ROW
BEGIN
SET @index = NEW.`index`;
SET @sms_count = (SELECT COUNT(*) FROM `pending` WHERE `index` = @index);
INSERT INTO `delivery` SET
`index` = @index, `countSMS` = @sms_count
WHERE `index` = @index;
END
что я делаю не так?
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 '' at line 4