Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 10 Mar 2008 @ 23:15:23 GMT


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


Subj:   Re: NULL handling in Cumulative Sum function
 
From:   Dieter Noeth

just use CASE:

     ,CASE WHEN amt IS NULL THEN 0 ELSE
         SUM(amt) OVER (PARTITION BY s.customer_id
              ORDER BY s.transid ASC
              ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
       END

Dieter



     
  <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: 23 Jun 2019