我们如何在现有MySQL表的一栏中添加注释?
这可以通过在使用ALTERTABLE命令修改列的同时使用'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)热门推荐
10 毕业祝福语保安文案简短
11 保持快乐祝福语大全简短
12 考试专属祝福语大全简短
13 贺卡祝福语情侣搞笑简短
14 新年祝福语小知识简短
15 给生病公公祝福语简短
16 新人结婚简短祝福语大全
17 送给员工美好祝福语简短
18 中式婚礼贺词祝福语简短