共計(jì) 593 個(gè)字符,預(yù)計(jì)需要花費(fèi) 2 分鐘才能閱讀完成。
這篇文章主要介紹 sql 如何在一個(gè)表中添加字段并添加備注,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
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;
以上是“sql 如何在一個(gè)表中添加字段并添加備注”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注丸趣 TV 行業(yè)資訊頻道!
正文完