Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create table 1

Status
Not open for further replies.

Souvik

Technical User
Apr 2, 2003
11
IN
Is there a way to create a table in Teradta as a select statement in teradata, as there is in Oracle? If yes, what is the syntax?

Thanks!!
 


CREATE TABLE target_table AS
(SELECT .... )
WITH [NO] DATA;

WITH DATA -- Populate the table as well
WITH NO DATA -- only create the table.
 
The CREATE TABLE AS is Standard SQL, but you probably have to add a Primary Index, because the default is a NUPI on the first column and this may result in a skewed table:

create table foo as (any complex select) with data primary index (columnA, columnB);

Dieter
 
In addition to Dieter, you can add SET / MULTISET to check if you need multiple rows or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top