在MySQL数据库中, 字段或列的注释是用属性comment来添加. 创建新表的脚本中, 可在字段定义脚本中添加comment属性来添加注释. 示例代码如下: create table test( id int not null default 0 comment '用户id' ) 如果是已经建好的表, 也可以用修改字段的命令,然后加上comment属性定义,就可以添加上注释了. 示例代码如下: alter table test change column id id int not null
一.Oracle --创建表 create table test ( id varchar2(200) primary key not null, sort number, name varchar(200) ) --字段加注释 comment on column test.id is 'id'; comment on column test.sort is '序号'; --表加注释 comment on table test is '测试表' 二.Mysql -
给字段加注释 comment on column testtb17.AGE is '年龄';comment on column testtb17.CREATEDTIME is '创建时间';comment on column testtb17.ID is '唯一标识';comment on column testtb17.NAME is '名字'; 给表加注释comment on table testtb17 is 'SEVENTEEN';