Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 05 Dec 2008 @ 20:07:30 GMT


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


Subj:   Re: Rank and Delete?
 
From:   Saxena, Rakesh

Hi Bob,

Here is the converted query for delete operation.

Double check whether the valid data is getting deleted before performing the deletion.

     delete from DB.forecast_table
     where FRC_CD = 52 and
     run_dt in
     (
       select run_Dt from
       (
       SELECT RUN_DT,
       RANK() OVER (ORDER BY RUN_DT)
       FROM DB.forecast_table
       WHERE FRC_CD = 52
       GROUP BY RUN_DT
       QUALIFY RANK() OVER (ORDER BY RUN_DT) >24
       ) b
     );

Regards

Rakesh Saxena.



     
  <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: 28 Jun 2020