Home > Database > Mysql Tutorial > body text

sql数据表复制语句

WBOY
Release: 2016-06-07 17:48:46
Original
1679 people have browsed it

本文章来介绍二种关于数据表复制sql语句,有需要的朋友可以参考一下方法很简单哦。

1.在没有目标表的情况下使用

  需要注意的是, 这种方法可以自动的创建表,但是不会创建主键.

  例如   列 into 目标表名 from 源表名

     

 代码如下 复制代码
 select *  into wx from zl

2.在目标表已经存在的情况下使用

  这种情况下目标表最好取消自动增长列的 自动增长 ,不会就引起错误.

    例如 insert into 表(列) select (列) from 表

    

 代码如下 复制代码
  select into wx(w,x) select z,l from zl
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