我正在尝试删除一个带有问号标记的列:
ALTER TABLE player DROP is_playing?;
结果:
ERROR 1064 (42000): 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 '?' at line 2
你知道其他方法吗?
由于
答案 0 :(得分:4)
使用反引号来转义MySQL中具有特殊名称或名称reserved keywords的列名或表名。
并使用column
关键字:
ALTER TABLE player DROP column `is_playing?`;