oracle create as select

Solutions on MaxInterview for oracle create as select by the best coders in the world

showing results for - "oracle create as select"
Federica
27 Jul 2019
1-- Copy a table (datas, columns and storage parameters)
2CREATE TABLE my_new_table AS SELECT * FROM my_source_table;
3-- Use NOLOGGING, and PARALLEL if allowed for faster copy
4CREATE TABLE my_new_table
5    PARALLEL 10 NOLOGGING
6AS
7SELECT /*+ parallel(10) */ * FROM my_source_table;
8-- To create an empty table:
9CREATE TABLE my_new_table AS SELECT * FROM my_source_table
10	WHERE rownum = 0;
Luciano
19 Aug 2019
1CREATE TABLE my_table AS
2SELECT * FROM another_table t
3WHERE 1=2 --delete the where condition if you also want the data