Archives of the TeradataForum
Message Posted: Thu, 21 Dec 2012 @ 03:30:25 GMT
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
|