我正在尝试删除带有问号符号的列:
ALTER TABLE player DROP is_playing?;
Run Code Online (Sandbox Code Playgroud)
结果:
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
Run Code Online (Sandbox Code Playgroud)
你还知道其他扔掉它的方法吗?
谢谢
使用反引号来转义MySQL 中具有特殊名称或保留关键字名称的列或表名称。
并使用column关键字:
ALTER TABLE player DROP column `is_playing?`;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
921 次 |
| 最近记录: |