Home > Database > Mysql Tutorial > body text

mysql 表维护与改造代码分享_MySQL

WBOY
Release: 2016-06-01 13:23:27
Original
902 people have browsed it

bitsCN.com 改变列的数据类型
[sql]
ALTER TABLE visitor MODIFY nam VARCHAR(30);
追加新列
[sql]
ALTER TABLE visitor ADD age INT;
ALTER TABLE visitor ADD age INT FIRST;
ALTER TABLE visitor ADD age INT AFTER nam;
改变列的位置
[sql]
ALTER TABLE visitor MODIFY age INT AFTER nam;
改变列名 和 类型
[sql]
ALTER TABLE visitor CHANGE birth birthday DATE;
删除列
[sql]
ALTER TABLE visitor DROP age;
表的复制
[sql]
CREATE TABLE customerH SELECT * FROM customer;
CREATE TABLE customerG LIKE customer;
INSERT INTO customerG SELECT * FROM customer;
INSERT INTO tb1G(no) SELECT bang FROM tb1;
表的删除
[sql]
DROP TABLE IF EXISTS customerG;
DROP TABLE customerG;bitsCN.com

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!