mysql - sql 语句更改表结构,添加多个列,怎么写?
PHP中文网
PHP中文网 2017-04-17 14:59:58
0
3
618

添加一个列是这样的:
ALTER TABLE tablename ADD 列名 数据类型
那多个呢?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
刘奇

ALTER TABLE tablename ADD COLUMN column name data type, ADD COLUMN column name data type;

洪涛

Add column
alter table mytable add name varchar(10)
Delete column
alter table mytable drop column name
Modify column type
alter table mytable alter column name nvarchar(10 )

伊谢尔伦

Add multiple columns:
alter table mytable add name varchar(10), add name2 varchar(10); you can continue to add
modify
alter table mytable modify name varchar(10), modify name2 varchar (10);You can continue to add

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template