我有一个类似这样的案例陈述:
CASE
WHEN purpose = "" THEN SET @sPurpose = "%%"
WHEN purpose IS NULL THEN SET @sPurpose = "%%"
ELSE SET @sPurpose = concat("%",purpose,"%");
END;
但是当我尝试编译该过程时,它会引发此错误:
SQL Error: 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
'WHEN purpose IS NULL THEN SET @sPurpose = "%%" ELSE SET @sPurpose = co' at line 13
我只是错过了一些语法上的东西吗?