zoukankan      html  css  js  c++  java
  • CUBRID学习笔记 30 复制表结构 cubrid教程

    语法

    CREATE {TABLE | CLASS} <new_table_name> LIKE <old_table_name>

     

     

     

    如下

     

     

    CREATE TABLE a_tbl(

    id INT NOT NULL DEFAULT 0 PRIMARY KEY,

    phone VARCHAR(10));

    INSERT INTO a_tbl VALUES(1,'111-1111'), (2,'222-2222'), (3, '333-3333');

     

    --creating an empty table with the same schema as a_tbl

    CREATE TABLE new_tbl LIKE a_tbl;

    SELECT * FROM new_tbl;

     

    There are no results.

     

    ;schema a_tbl

     

    === <Help: Schema of a Class> ===

     

     

     <Class Name>

     

         a_tbl

     

     <Attributes>

     

         id                   INTEGER DEFAULT 0 NOT NULL

         phone                CHARACTER VARYING(10)

     

     <Constraints>

     

         PRIMARY KEY pk_a_tbl_id ON a_tbl (id)

     

    Current transaction has been committed.

     

    ;schema new_tbl

     

    === <Help: Schema of a Class> ===

     

     

     <Class Name>

     

         new_tbl

     

     <Attributes>

     

         id                   INTEGER DEFAULT 0 NOT NULL

         phone                CHARACTER VARYING(10)

     

     <Constraints>

     

         PRIMARY KEY pk_new_tbl_id ON new_tbl (id)

     

     

    Current transaction has been committed.

     

  • 相关阅读:
    Owin
    C#不区分大小写的字符串替换(Replace)函数
    如何创建测试程序调试nginx数据结构
    一张脑图说清 Nginx 的主流程
    gdb常用命令记录
    nginx的configure流程
    c 编译器大全
    PHP 的 uniqid 函数产生的 id 真的是唯一的么?
    UUID那些事
    PHP 编码规范
  • 原文地址:https://www.cnblogs.com/wang2650/p/5287794.html
Copyright © 2011-2022 走看看