Home > Database > Mysql Tutorial > Related operations of mysql table

Related operations of mysql table

黄舟
Release: 2017-01-17 13:10:48
Original
1363 people have browsed it

Mysql table related operations

Create table

create table tt
Copy after login

Create table if not available

create table if not exists tt
Copy after login

Copy table structure

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

Copy table data

If the result is the same,

insert into t2 select * from t1
Copy after login

Only need to copy some Field,

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

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 (m.sbmmt.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