Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 26 May 2009 @ 09:23:25 GMT


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


Subj:   Re: Creating one table from another
 
From:   mandasmitha.subramanya

Thanks for the response.

I am still not clear about the second method. Let me be more clear in my question.

Three ways in which a table can be created are:

1. Using CREATE TABLE DDL - define the columns and datatypes

2. Create a table from an existing table using following syntax

          CREATE TABLE A as
          (SELECT col1, col2...coln from B) with data
           PRIMARY INDEX (col_names);

3. Create table structure from and existing table using following syntax

          CREATE TABLE A as
          (SELECT col1, col2...coln FROM B) with no data
           PRIMARY INDEX (col_names);

          INSERT INTO A
          SELECT col1, col2...coln FROM B;

Which is more efficeint out of the above three and how?

Lakhwant,

Can you please elaborate on this statement

'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'


Thanks in Advance



     
  <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