我们可以在修改列时将“comment”关键字与 alter table 命令一起使用,以在列上添加注释。例如,如果我们想在表“testing”的“id”列中添加注释,则以下查询将执行此操作 -
mysql> alter table testing modify id int comment 'id of employees';query ok, 0 rows affected (0.07 sec)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 table 命令在列上添加注释?的详细内容。
   
 
   