我的mysql的版本是5.6,
以下运行的话正常应该使abc=3,但是却出现错误:
[Err] 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 4  但是以下两种情况都能运行: SET @abc=if(1>2,3,2); 也可以尝试把set换成select也可以运行: DELIMITER $$
DROP PROCEDURE IF EXISTS TEST
$$ CREATE PROCEDURE `TEST`(IN aaa INT) BEGIN -- SELECT @abc=if(1>2,3,2); END $$
DELIMITER ;
有没有人知道原因?