#1064 - 您的SQL语法有错误;

时间:2015-10-05 03:53:07

标签: php mysql sql database triggers

遇到以下SQL问题,显示错误消息(#1064 - You have an error in your SQL syntax;)但无法确定问题所在。

CREATE TRIGGER name
BEFORE INSERT ON c
FOR EACH ROW
BEGIN
    DECLARE a INT;
    set a = 0;
    WHILE (select count() from c where c.id == a) > 0 DO   
        SET a = a + 1; 
    END WHILE;
    SET new.id = a;
END;

0 个答案:

没有答案