Thursday, April 20, 2017

Oracle copy data to another table

If you want to create a table with data. First, create the table:
create table new_table as ( select * from old_table); 
and then insert
insert into new_table ( select * from old_table);
If you want to create a table without data. You can use:

create table new_table as ( select * from old_table where 1=0);