Presto 0.76 Documentation

6.2. CREATE TABLE

6.2. CREATE TABLE

Synopsis

CREATE TABLE table_name AS query

Description

Create a new table containing the result of a SELECT query.

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