|
|
Archives of the TeradataForum
Message Posted: Wed, 02 Jan 2008 @ 15:09:59 GMT
Subj: | | Re: Finding previous value |
|
From: | | Rob Paller |
You can use the MIN or MAX window aggregates and specify ROWS BETWEEN 1 FOLLOWING and 1 FOLLOWING or ROWS BETWEEN 1 PRECEDING and 1 PRECEDING
to get either the subsequent or preceding values, respectively.
Your example is vague as you don't indicate how the ADVC_NUM is assigned and the effective dates are the same making it difficult to determine
how to order your partition.
Hope this helps.
Regards,
Rob
| |