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   //灵活加条件,根据查询的结果作为结构及数据

    )

  • 相关阅读:
    c#剪切板操作
    eclipse mvn build error tips
    Redis Tips
    IntilliJ Idea 使用中的问题与解决方案
    mongo
    python
    SQL Relative
    sybase update
    run current vim file
    git
  • 原文地址:https://www.cnblogs.com/hebiao/p/14325902.html
Copyright © 2011-2022 走看看