在MySQL中重命名表 [英] Rename a table in MySQL
本文介绍了在MySQL中重命名表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
重命名表在MySQL中不起作用
Renaming a table is not working in MySQL
RENAME TABLE group TO member;
错误讯息为
#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 'group
RENAME TO member' at line 1
查询对我来说在其他表上正常工作,但不是表 group
。
The query is working fine on other tables for me, but not with the table group
.
推荐答案
group
是一个关键字( GROUP BY )在MySQL中,您需要用反引号包围它,以显示MySQL,您希望将其解释为表名:
group
is a keyword (part of GROUP BY) in MySQL, you need to surround it with backticks to show MySQL that you want it interpreted as a table name:
RENAME TABLE `group` TO `member`;
这篇关于在MySQL中重命名表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文