1、加字段:
alter table 表名 ADD 字段名 類(lèi)型;
eg:
alter table sys_cwzd ADD SCCLLJ VARCHAR2(50);
2、加備注:
comment on column 表名.字段名 is '備注名';
eg:
comment on column sys_cwzd.SCCLLJ is '上傳材料路徑';
內(nèi)容擴(kuò)展:
添加新字段:
alter table bulletin add citycode varchar(6) not null default 0; # 城市代碼
1.創(chuàng)建數(shù)據(jù)庫(kù)時(shí)設(shè)置編碼
create database test character set utf8;
2.創(chuàng)建表時(shí)設(shè)置編碼
create table test(id int primary key)DEFAULT charset=utf8;
3.修改數(shù)據(jù)庫(kù)編碼
alter database test character set utf8;
4.修改表默認(rèn)編碼
alter table test character set utf8;
標(biāo)簽:云浮 武威 白銀 聊城 湖南 湖北 烏海 臨汾
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《sql在一個(gè)表中添加字段并添加備注的方法》,本文關(guān)鍵詞 sql,在,一個(gè),表中,添加,字段,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。