Copying Table Definitions - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

The AS clause copies definitions for an existing table or query expression to a new table.

The following table describes the various AS options.

Use this option … To copy from an existing source table or query expression to a new target table …
AS …WITH NO DATA the specified column definitions only.
AS … WITH DATA the specified column definitions and the data associated with those columns.

Note that you cannot create a global temporary table using the WITH DATA option.

AS … WITH NO DATA AND STATISTICS the specified column definitions and their statistical histograms.

Data is not copied.

AS … WITH DATA AND STATISTICS the specified column definitions and their statistical histograms.

Data is copied.

Use count information is copied when USECOUNT is enabled for the target database. See BEGIN QUERY LOGGING.

To copy only a subset of the source table and, optionally, its statistics, specify a subquery that selects only those columns desired in the target table. You can also use the subquery option to specify column expressions based on columns in the existing table to define column modifications for the target table. See Using Subqueries To Customize An AS Clause for further information.