sql在一个表中添加字段并添加备注的方法

sql在一个表中添加字段并添加备注的方法,第1张

sql在一个表中添加字段并添加备注的方法

1、加字段:

alter table 表名 ADD 字段名 类型;

eg:

alter table sys_cwzd ADD SCCLLJ VARCHAR2(50); 

 

2、加备注:

comment on column 表名.字段名 is '备注名';

eg:

comment on column sys_cwzd.SCCLLJ is '上传材料路径';

 

内容扩展:

添加新字段:

alter table bulletin add citycode varchar(6) not null default 0; # 城市代码

1.创建数据库时设置编码

create database test character set utf8;

2.创建表时设置编码

create table test(id int primary key)DEFAULT charset=utf8;

3.修改数据库编码

alter database test character set utf8;

4.修改表默认编码

alter table test character set utf8;

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/893072.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-14
下一篇 2022-05-14

发表评论

登录后才能评论

评论列表(0条)

保存