zoukankan      html  css  js  c++  java
  • 复制表及表数据

    1.查看原表表结构

    show create table oldtbname;

    2.复制语句,执行,修改表名newtbname--复制表结构

    3.复制表数据

    insert into newtbname(a,b,c)  select a,b,c from oldtbname

     --------------------------------------------------------------------------------------------------

    复制表结构

    create table newtab 【as】 select * from emp where 1=2;

    ----------------------------------------------------------------------------------------

    复制表结构及数据

    create table newtab 【as】 select * from emp;//oracle要加as

     -----------------------------------------------------------------------------

    复制表结构及数据

    create table newtab(

    select * from old   //灵活加条件,根据查询的结果作为结构及数据

    )

  • 相关阅读:
    A
    hdu 2108 Shape of HDU(判定是不是凸多边形)
    F
    J
    扩展欧几里得
    G
    A
    D
    E
    H
  • 原文地址:https://www.cnblogs.com/hebiao/p/14325902.html
Copyright © 2011-2022 走看看