Archives of the TeradataForum
Message Posted: Wed, 02 Jan 2008 @ 15:09:59 GMT
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.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|