Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 08 Dec 2005 @ 08:09:56 GMT


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


Subj:   Re: Qualify Clause in Delete Query
 
From:   Michael Larkins

Hello Dinesh:

What if you did something like the following (not tested):

     Delete FROM Table1
      Where (1, Primary index columns )
      IN
      (SEL row_number () OVER (partition BY
                                   Primary index columns
                                   Order by column asc)
                                  ,Primary index columns
         FROM Table1
       Where 1 < (SEL count(*) FROM 
                          WHERE table1.column(s) = .column(s) ))

Using a corelated subquery should generater fewer sequential numbers ROW_NUMBER) and only the first one will be deleted.


Hope this helps,

Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor



     
  <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