17.00 - Example: Copy Table Without Data and Default Column Names - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

This CREATE TABLE … AS … WITH NO DATA request selects a subset of the columns from subquery_table for inclusion in target_table and retains their names.

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 column_1, column_2 
       FROM subquery_table )
     WITH NO DATA;