我收到查询错误:
ALTER TABLE `cms_users` ADD `show_on_web` TINYINT(4) NOT NULL DEFAULT '1';
我收到错误:
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 ' NOT NULL DEFAULT '1'' at line 1
我不确定错误是什么。
验证查询 - http://sqlfiddle.com
最佳答案
您可以在下面尝试 - 您需要添加列并且默认值为 1 而不是 '1' 因为您的数据类型是 tinyint
ALTER TABLE `cms_users`
ADD column `show_on_web` TINYINT(4) NOT NULL DEFAULT 1
关于mysql - 如何解决sql查询中的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53812349/