CREATE TABLE AS

Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ❌ Data 360 SQL ✅ Tableau Hyper API

markdownreferencev1Z5R1-DJCTguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sqlCREATE TABLE ASData 360Data CloudData 360 Query Guide

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table-as.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

CREATE TABLE AS

Applies to: ❌ Data 360 SQL ✅ Tableau Hyper API

Define a new table from the results of a query.

CREATE TABLE AS creates a table and fills it with data computed by a <query>, usually a SELECT command. The table columns have the names and data types associated with the output columns of the <query> (except that you can override the column names by giving an explicit list of new column names).

CREATE TABLE AS bears some resemblance to creating a view, but it is really quite different: it creates a new table and evaluates the query just once to fill the new table initially. The new table will not track subsequent changes to the source tables of the query. In contrast, a view re-evaluates its defining SELECT statement whenever it is queried.

TEMPORARY or TEMP If specified, the table is created as a temporary table. Refer to CREATE TABLE for details.

IF NOT EXISTS Do not throw an error if a table with the same name already exists. Refer to CREATE TABLE for details.

<table_name> The name (optionally schema-qualified) of the table to be created.

<column_name> The name of a column in the new table. If column names are not provided, they are taken from the output column names of the query.

<query> A SELECT command in any of its forms (SELECT, TABLE, or VALUES).

WITH [ NO ] DATA This clause specifies whether or not the data produced by the query should be copied into the new table. If not, only the table structure is copied. The default is to copy the data.

Create a new table films_recent consisting of only recent entries from the table films:

To copy a table completely, the short form using the TABLE command can also be used:

CREATE TABLE AS conforms to the SQL standard. The following are nonstandard extensions:

  • The standard requires parentheses around the subquery clause; in Hyper, these parentheses are optional.
  • In the standard, the WITH [ NO ] DATA clause is required; in Hyper it is optional.
  • Hyper handles temporary tables in a way rather different from the standard; see CREATE TABLE for details.

Read this document as markdown — the same bytes an agent receives.