gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 10:58:29 26 4
gpt4 key购买 nike

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

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com