Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 17 Aug 2005 @ 21:04:26 GMT


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


Subj:   Re: Deleting Duplicate rows
 
From:   Sridhar Nomula

Solution for the example below.

     DELETE FROM test a
     WHERE a.rowid  IN
      (SELECT x.rowid as DEL_ROWID FROM
          (SELECT a, b, c, MAX(rowid) as MAX_ROWID FROM test
          GROUP BY a, b, c
          HAVING COUNT(1) > 1) x,
         test y
      WHERE x.a = y.a
      AND x.b = y.b
      AND x.c = y.c
      AND x.rowid <> MAX_ROWID)

Let me know if this makes any sense.

-Sree



     
  <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