create table from select postgres code example
Example 1: create table postgresql
CREATE TABLE table_name (
column_name TYPE column_constraint,
table_constraint table_constraint
) INHERITS existing_table_name;
Example 2: postgresql create table as select
CREATE TABLE films_recent AS
SELECT * FROM films WHERE date_prod >= '2002-01-01';