Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 21 Jun 2013 @ 12:35:34 GMT


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


Subj:   Re: Fastest Way to Delete data from Table
 
From:   Poddar, Gautam

Trying following steps. This will be much faster and will maximize the data availability for Table1 as well.

Step 1.

     create table Table1_test as Table1 with no data;

Step 2

     insert into Table1_test
     select * from FROM Table1
       WHERE     (key1, key2) not IN
        (
           SELECT UNIQUE key1, key2 FROM Table2
         );

Step 3

     drop table Table1;

Step 4

     rename table Table1_test to Table1;

Thanks,

Gautam Poddar



     
  <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: 23 Jun 2019