我有以下程序
DELIMITER $$
CREATE PROCEDURE yesterday()
BEGIN
SELECT CURDATE()-INTERVAL 1 DAY;
END $$
DELIMITER;
虽然CALL yesterday();
生成了正确的输出,但该过程会编译错误。
错误是:
#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 'DELIMITER' at line 1
我找不到什么问题。 请帮忙!
答案 0 :(得分:1)
在DELIMITER
DELIMITER $$
CREATE PROCEDURE yesterday()
BEGIN
SELECT CURDATE()-INTERVAL 1 DAY;
END $$
DELIMITER ;