CREATE TABLE AS#
Примечание
Ниже приведена оригинальная документация Trino. Скоро мы ее переведем на русский язык и дополним полезными примерами.
Синтаксис#
Описание#
Create a new table containing the result of a SELECT query. Use CREATE TABLE to create an empty table.
The optional IF NOT EXISTS
clause causes the error to be
suppressed if the table already exists.
The optional WITH
clause can be used to set properties
on the newly created table. To list all available table
properties, run the following query:
Примеры#
Create a new table orders_column_aliased
with the results of a query and the given column names:
Create a new table orders_by_date
that summarizes orders
:
Create the table orders_by_date
if it does not already exist:
Create a new empty_nation
table with the same schema as nation
and no data: