Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 05 May 2004 @ 19:43:26 GMT


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


Subj:   Re: Deleting Duplicates with a single DELETE statement
 
From:   Thyagarajan, Vivek

Guys,

Thanks for all your response.

I never knew that I could use ROWID in Teradata. That's what I use all the time in Oracle.

Below is my SQL which deletes all duplicates:

     delete from  vthyagar.Inv_Header a
     where a.rowid
     >(
     select min(b.rowid)
     from vthyagar.Inv_Header  b
     where a.Invoice_Nbr=b.Invoice_Nbr
     and a.Company_Cd=b.Company_Cd)
     ;


     
  <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