Home  >  Article  >  Database  >  Related operations of mysql table

Related operations of mysql table

黄舟
黄舟Original
2017-01-17 13:10:481319browse

Mysql table related operations

Create table

create table tt

Create table if not available

create table if not exists tt

Copy table structure

create table t2 like t1  
create table t2 select * from t1 where 1 = 2

Copy table data

If the result is the same,

insert into t2 select * from t1

Only need to copy some Field,

insert into t2 (column1, column2, ...) select (column1, column2, ...) from t1

The above is the content of the related operations of the mysql table. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


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