CREATE TABLE AS

Synopsis

CREATE TABLE table_name AS query

Description

Create a new table containing the result of a SELECT query. Use CREATE TABLE to create an empty table.

Examples

Create a new table orders_by_date that summarizes orders:

CREATE TABLE orders_by_date
AS
SELECT orderdate, sum(totalprice) AS price
FROM orders
GROUP BY orderdate

See Also

CREATE TABLE, SELECT