15.10 - Example: Copy Table with Data and Default Column Names - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

This CREATE TABLE … AS … WITH DATA request selects all columns from the subquery for inclusion in target_table and retains their names. The request also copies the data from the selected columns into target_table.

Because the request specifies a subquery and no explicit table kind is specified, the table kind of target_table defaults to the session mode default, not to the table kind of subquery_table.

     CREATE TABLE target_table AS (
       SELECT * 
       FROM subquery_table )
     WITH DATA;