Home > Database > Mysql Tutorial > MySQL批改列

MySQL批改列

WBOY
Release: 2016-06-07 16:27:15
Original
1023 people have browsed it

MySQL修改列 ALTER TABLE:添加,修改,删除表的列,约束等表的定义。查看列:desc 表名;修改表名:alter table t_book rename to bbb;添加列:alter table 表名 add column 列名 varchar(30);删除列:alter table 表名 drop column 列名;修改列名MySQL:alte

MySQL修改列
ALTER TABLE:添加,修改,删除表的列,约束等表的定义。

查看列:desc 表名;

修改表名:alter table t_book rename to bbb;

添加列:alter table 表名 add column 列名 varchar(30);

删除列:alter table 表名 drop column 列名;

修改列名MySQL:
alter table bbb change nnnnn hh int;

修改列名SQLServer:
exec sp_rename't_student.name','nn','column';

修改列名Oracle:
alter table bbb rename column nnnnn to hh int;

修改列属性:alter table t_book modify name varchar(22);
sp_rename:SQLServer 内置的存储过程,用与修改表的定义。
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template