Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 17 Aug 2005 @ 18:31:26 GMT


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


Subj:   Re: Deleting Duplicate rows
 
From:   sanjaya.nagabhushan

Sharma,

Here is a way of deleting duplicate rows the way you want it...

1) Modify your table to have a PI that includes all columns

     CREATE MULTISET TABLE TEST.test1 ,NO FALLBACK ,
          NO BEFORE JOURNAL,
          NO AFTER JOURNAL,
          CHECKSUM = DEFAULT
          (
           a VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC,
           b VARCHAR(20) CHARACTER SET LATIN NOT CASESPECIFIC,
           c DECIMAL(17,0))
     PRIMARY INDEX ( a ,b ,c );

2) Enable DBSControl Internal Flag "ROWIDEnabled" to TRUE. This would allow you to use ROWID in your DML.

(I believe this is to be used very cautiously & in exceptional cases only. Don't have details to fill in here)

3) delete from test1 where substr(rowid,9,1) > '01'xb;


Regards,

Sanjaya



     
  <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