MySQL:删除带有问号符号的列?

标签 mysql sql-drop

我正在尝试删除带有问号符号的列:

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

你知道其他方法吗?

谢谢

最佳答案

使用反引号转义具有特殊名称或名称 reserved keywords 的列或表名称在 MySQL 中。

并使用 column 关键字:

ALTER TABLE player DROP column `is_playing?`;

关于MySQL:删除带有问号符号的列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18161317/

相关文章:

postgresql - 删除所有 View PostgreSQL

tsql - 如何在发布和订阅中删除复制表

mysql - Django 重置不删除表

php - mysql查询问题

mysql - 如何使用主题标签(我喜欢#running)作为帖子中的链接?

php - 如何基于 GET 搜索选择多个字段?

sql-server - 检查在 SQL Server 上运行了哪些 'DROP' 查询

sql - 如何一次性删除许多(但不是全部)表?

java - 将 MySQL 连接到 Spring 应用程序

mysql - 限制 SQL 查询中每个 ID 的行数