|
|
Archives of the TeradataForum
Message Posted: Thu, 03 Jan 2008 @ 15:31:10 GMT
Subj: | | Re: Finding previous value |
|
From: | | Michael Larkins |
Hello Krithiga:
The two examples that you have provided are a bit too simpliest (I think) in order for anyone to give you a good answer. As indicated in
previous answers, you will need OLAP functions like MIN/OVER to accomplish the processing. However, you have not discussed what happens with you
have multiple "previous" effective dates. Do you want the first date or only the one that is just prior to the current effective date. What
happens when you have multiple rows for the same "previous" effective date (like your 03/25/2007 rows)? Do you want all of them or only one?
If you want only one, what determines which one you want?
These are just a few of the questions that I can think of off the top of my head. If you want a good solution, you need to provide good
specifications and not generalities.
Regards,
Michael Larkins
Certified Teradata Master
Certified Teradata SQL Instructor
| |