Presto 0.57 Documentation

3.2. CREATE TABLE

3.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