Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 20 May 2009 @ 15:18:13 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Creating one table from another
 
From:   Singh, Lakhwant

Hi,

You mentioned:

1. Using CREATE TABLE statement

2. Using CREATE AS SELECT syntax (with data/ with no data)


Assuming your FIRST method: "Create Table A as B (with data /with no data)"

Assuming your SECOND method: "Create Table A as Select * From B"

FIRST one is better method because with the SECOND method you can not specify constraints (if any on existing table) in the create table statement.

Also, there TWO variations for the FIRST method:

Creating table using Locking statement with "with data" variation i.e.

     Locking Table B for ACCESS
     Create Table A as B with data;

IS SAME AS the following 2 step process -

     Create Table A as B with NO data;

     Insert into A
     Select * FROM B;

Thanks

Lakhwant



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023