oracle create table as select code example
Example 1: create table oracle
CREATE TABLE ot.persons(
person_id NUMBER GENERATED BY DEFAULT AS IDENTITY,
first_name VARCHAR2(50) NOT NULL,
last_name VARCHAR2(50) NOT NULL,
PRIMARY KEY(person_id)
);
Example 2: oracle sql create table from select
CREATE TABLE my_new_table AS SELECT * FROM my_source_table;
CREATE TABLE my_new_table
PARALLEL 10 NOLOGGING
AS
SELECT * FROM my_source_table;
CREATE TABLE my_new_table AS SELECT * FROM my_source_table
WHERE rownum = 0;