gpt4 book ai didi

mysql - 在 MySQL 中重命名表的列名

转载 作者:行者123 更新时间:2023-11-29 05:10:07 25 4
gpt4 key购买 nike

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 'sp_rename 'records.student_id', 'id', 'COLUMN'' at line 1.

帮助解决这个错误。

mysql> sp_rename 'records.student_id', 'id', 'COLUMN';

最佳答案

这样试试。没有引号。

ALTER TABLE records CHANGE student_id id INT(6) NOT NULL AUTO_INCREMENT;

关于mysql - 在 MySQL 中重命名表的列名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40805783/

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