遇到以下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;