how to create a table from a query in psql code example
Example: postgresql create table as select
CREATE TABLE films_recent AS
SELECT * FROM films WHERE date_prod >= '2002-01-01';
CREATE TABLE films_recent AS
SELECT * FROM films WHERE date_prod >= '2002-01-01';