Archives of the TeradataForum
Message Posted: Thu, 15 Sep 2011 @ 16:02:25 GMT
Subj: | | Re: Mdiff on Date field |
|
From: | | Dieter Noeth |
Anomy.Anom wrote:
| However could you pl explain what is the significance of using " rows between 1 preceding and 1 preceding" in the query. | |
| Is it required to specify "1 preceding" two times? | |
"rows between 1 preceding and 1 preceding" is used to access the previous row's data. But "rows 1 preceding" equals "rows between 1 preceding
and current row". This will return the minimum value of the previous and the current row and the result for the first row will differ:
ID date
1 28-Jan null vs. 0
1 31-Jan 3 3
Dieter
|