我们如何使用MySQL ALTER TABLE命令在列上添加注释?
在修改列以在列上添加注释时,我们可以在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)热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短