Historical version. PostgreSQL 6.4 has reached end of support. See the current manual.
SELECT INTO
Name
SELECT INTO — Create a new table from an existing table or viewSELECT [ ALL | DISTINCT ] expression [ AS name ] [, ...]
INTO [ TABLE ] new_table ]
[ FROM table [alias] [, ...] ]
[ WHERE condition ]
[ GROUP BY column [, ...] ]
[ HAVING condition [, ...] ]
[ UNION [ ALL ] select]
[ ORDER BY column [ ASC | DESC ] [, ...] ]
Inputs
All input fields are described in detail for SELECT.
Outputs
All output fields are described in detail for SELECT.
Description
SELECT INTO creates a new table from the results of a query. Typically, this query draws data from an existing table, but any SQL query is allowed.
Note: CREATE TABLE AS is functionally equivalent to the SELECT INTO command.
Report a documentation issue
Read the upstream documentation. For corrections, first check the current manual.