gpt4 book ai didi

php - 在 MySQL 中将 TABLE 101 重命名为 table101

转载 作者:行者123 更新时间:2023-11-30 21:43:11 25 4
gpt4 key购买 nike

所以我有这个通过导入 csv 创建的表格。表的名称是 TABLE 101。显然查询不会对它起作用,因为它包含一个空格?

如何将其重命名为 table101 或其他名称?

我试过这个:-

ALTER TABLE ['TABLE 101']
RENAME TO ['tavle101']

但它不起作用,这是错误:-

静态分析:

6 errors were found during analysis.

Unexpected character. (near "[" at position 12) Unexpected character. (near "]" at position 24) Unexpected character. (near "[" at position 37) Unexpected character. (near "]" at position 48) A new statement was found, but no delimiter between it and the previous one. (near "RENAME" at position 27) Unrecognized alter operation. (near "RENAME" at position 27) SQL query:

ALTER TABLE ['TABLE 101'] RENAME TO ['tavle101']

MySQL said: Documentation

1064 - 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 '['TABLE 101'] RENAME TO ['tavle101']' at line 1

我做错了什么?

将 MySQL 与 phpmyadmin 结合使用

最佳答案

您需要使用 `Grave accent(``) 字符而不是方括号 []。

    Rename TABLE `TABLE 101`  TO  tavle101;

关于php - 在 MySQL 中将 TABLE 101 重命名为 table101,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50660952/

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