CREATING TABLE FROM OTHER Table
CREATING TABLE FROM OTHER Table
The below one creates new table and copies all data
CREATE TABLE {new_table_name} AS (SELECT * FROM {old_table_name});
The below one creates new table without copying data
CREATE TABLE {new_table_name} AS (SELECT * FROM {old_table_name} WHERE 1=2);
The below one creates table with selected columns only
CREATE TABLE {new_table_name} AS (SELECT column_1, column2, ... column_n FROM {old_table_name});
columns from multiple tables
CREATE TABLE {new_table_name} AS (SELECT column_1, column2, ... column_n FROM old_table_1, old_table_2, ... old_table_n);