返回顶部

收藏

oracle复制表结构

更多
SQL>
SQL> CREATE TABLE myTable (
  2     Name    VARCHAR(50) PRIMARY KEY NOT NULL,
  3     PhoneNo VARCHAR(15) DEFAULT 'Unknown Phone',
  4     SSN     VARCHAR(15) NOT NULL,
  5     CHECK (SSN LIKE '[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]'));

Table created.

SQL>
SQL>
SQL> CREATE TABLE My_myTables AS SELECT * FROM myTable
  2  WHERE 1=0;

Table created.

SQL>
SQL> drop table myTable;

Table dropped.

SQL> drop table My_myTables;

Table dropped.

标签:Oracle,SQL

收藏

0人收藏

支持

0

反对

0

发表评论