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 '上傳材料路徑';
內(nèi)容擴(kuò)展:
添加新字段:
alter table bulletin add citycode varchar(6) not null default 0; # 城市代碼
1.創(chuàng)建數(shù)據(jù)庫時(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ù)庫編碼
alter database test character set utf8;
4.修改表默認(rèn)編碼
alter table test character set utf8;
您可能感興趣的文章:- MySQL表中添加時(shí)間戳的幾種方法
- Mysql如何適當(dāng)?shù)奶砑铀饕榻B
- MYSQL實(shí)現(xiàn)添加購物車時(shí)防止重復(fù)添加示例代碼
- MySQL實(shí)現(xiàn)創(chuàng)建存儲(chǔ)過程并循環(huán)添加記錄的方法
- MySQL常用的建表、添加字段、修改字段、添加索引SQL語句寫法總結(jié)