Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 17:35:49
Original
1031 people have browsed it

一、复制表的语法: 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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!