代码如下。
SELECT MAX(days) INTO @_days FROM my_table; -- compiles ok
-- problems start here
IF DAYOFWEEK(@_days) = 6 THEN
INSERT INTO my_table(days) VALUES(DATE_ADD(@_days,INTERVAL 2 DAY));
ELSE
INSERT INTO my_table(days) VALUES(DATE_ADD(@_days,INTERVAL 1 DAY));
END IF;
我得到的错误是#1064。我的mysql版本是5.5.25