Create table as select * from another
SQL> create table myTable(
2 key_col primary key,
3 key_val
4 )as
5 select object_name, max( owner||'_'||object_id )from all_objects group by object_name
6 /
Table created.
SQL>
SQL>
SQL>
SQL> create table myTableCopy(
2 key_col primary key,
3 key_val )
4 as select * from myTable;
Table created.
SQL>
SQL>
SQL> drop table myTable;
Table dropped.
SQL>
SQL> drop table myTableCopy;
Table dropped.
Related examples in the same category