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 ‘NULL’ at line 1
今天使用mysql事件执行一段程序,
set @deletesql =CONCAT('DELETE from classuserorder',' where a=',a);
PREPARE stmt FROM @deletesql;
EXECUTE stmt ;
DEALLOCATE PREPARE stmt;
老是报异常,看错误应该是sql中有null,应该是concat拼接null后结果@deletesql为null,导致报错,对参数a做下判断即可