Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 28 Oct 2009 @ 19:45:03 GMT


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


Subj:   Re: Delete duplicate rows from a MULTISET table
 
From:   Rob Paller

What is the best query that would delete duplicate rows from a MULTISET table?

0) Backup the table.

1) Create clone of your table (without data)

2) INSERT INTO SELECT * FROM QUALIFY ROW_NUMBER() OVER(PARTITION BY ORDER BY ) = 1;

3) DELETE FROM ;

4) INSERT INTO SELECT * FROM ; OR RENAME TABLE AS _old; RENAME TABLE AS ;

5) DROP whichever table is remaining depending on which approach you took in step 4.

6) Backup the newly cleansed table.



     
  <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