在mysql中这样写会报错:
[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 'end
if' at line 8
存储过程,如下:
修改成以下这样,就可以了:
下在的存储过程,多做了一步判断,什么也不做,避免了子句为空时报错。