Home >Database >Mysql Tutorial >MySQL数据库添加一个字段_MySQL

MySQL数据库添加一个字段_MySQL

WBOY
WBOYOriginal
2016-06-01 13:17:591188browse

bitsCN.com

MySQL数据库添加一个字段

1、添加一个字段

alter table tableName add 列名  数据类型;

2、添加一个字段设置默认值

alter table tableName add 列名  数据类型 default 0;

(注:设置默认值为0)

 

参考:http://hi.baidu.com/pianxicun/item/bf6785097ba43d304bc4a36d

bitsCN.com
Statement:
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