1. Copy table Syntax: createtable table name as (subquery) Example: copy the table empcreatetablemyemp in scott, the default database installed by El.
1. syntax for copying a table: create table name as (subquery) Example: copy the table emp create table myemp in scott, the default database installed with external el.
I. Syntax of copying a table:
Create table name as (subquery)
Example: copy the emp table in scott, the default database installed by El.
Create table myemp as (select * from emp );
In this example, the table structure and table content are copied together.
Ii. Copy the table structure
Create table name as (subquery where 1 = 2), that is, adding a condition that is never possible (1 = 2) on the basis of the above ), in this case, only the table structure is copied, but the table content is no longer displayed.
Example: create table myemp2 as (select * from emp where 1 = 2 );
,