---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/create-table-as.md
cuppy_section: docs
cuppy_doc: Z5R1-DJCT
cuppy_doc_uuid: 58fcb454-e4b4-4dc6-b87e-3ebec2051c63
cuppy_permalink: https://cuppy.io/salesforce/d/Z5R1-DJCT
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/create-table-as
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: f0ceccf8982371cafeb56618807c4c33ab760536dbf561e1c1d91beb9ca411e4
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> 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](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/select.html) 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](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html) for details.

`IF NOT EXISTS`
Do not throw an error if a table with the same name already exists. Refer to [CREATE TABLE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html) 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](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/select.html) 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](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html) for details.


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
