Home  >  Article  >  Database  >  Oracle相同用户相同库Copy表结构

Oracle相同用户相同库Copy表结构

WBOY
WBOYOriginal
2016-06-07 17:35:491032browse

一、复制表的语法: create table 表名称 as (子查询) 例子: 复制oracel安装后的默认数据库scott中的表emp create table myemp

一、复制表的语法:

create table 表名称 as (子查询)

例子: 复制oracel安装后的默认数据库scott中的表emp

create table myemp as (select * from emp);

此例是表示表结构和表内容一起复制过来了。

二、复制表结构

create table 表名称 as (子查询 where 1=2) ,即在上述的基础上加入了一个永远不可能成立的条件(1=2),则此时表示的是只复制表结构,但不复制表的内容。

例子:create table myemp2 as (select * from emp where 1=2);

linux

Statement:
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