admin管理员组文章数量:1566992
在修改列以在列上添加注释时,我们可以在ALTER TABLE命令中使用'COMMENT'关键字。例如,如果我们想在表“ testing”的“ id”列中添加注释,那么下面的查询将做到这一点-mysql> ALTER TABLE testing MODIFY id INT COMMENT 'id of employees';
Records: 0 Duplicates: 0 Warnings: 0
通过以下查询,可以在列的注释字段中对其进行检查。mysql> Show full columns from testing\G
*************************** 1. row ***************************
Field: id
Type: int(11)
Collation: NULL
Null: NO
Key: PRI
Default: 0
Extra:
Privileges: select,insert,update,references
Comment: id of employees
*************************** 2. row ***************************
Field: Name
Type: varchar(20)
Collation: latin1_swedish_ci
Null: YES
Key:
Default: NULL
Extra:
Privileges: select,insert,update,references
Comment:
2 rows in set (0.05 sec)
版权声明:本文标题:mysql alter 添加注释_我们如何使用MySQL ALTER TABLE命令在列上添加注释? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1725880920a1046844.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论