Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 21 Dec 2012 @ 03:30:25 GMT


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


Subj:   Re: Help needed with Lead and Lag functions
 
From:   Benjamin.E.Ford

You can try PRECEDING and FOLLOWING. Experiment with statements like these...

     action_name OVER (PARTITION BY ID,request_name
     ORDER BY timestamp_det ROWS BETWEEN 1
     FOLLOWING AND 1 FOLLOWING) next_action

     action_name OVER (PARTITION BY ID,request_name
     ORDER BY timestamp_det ROWS BETWEEN 1
     PRECEDING AND 1 PRECEDING) previous_action

Ben Ford
Report Developer



     
  <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