I have a Table looking like this (Cols A-D):
A B C D E
----------------------------------------------------------
1 2011 2011-06-30 A 2013-06-30
1 2012 2012-06-30 A 2013-06-30
1 2013 2013-06-30 A 2013-06-30
1 2014 2015-06-30 B 2015-06-30
1 2015 9999-12-31 A 9999-12-31
2 2014 9999-12-31 C 9999-12-31
2 2015 9999-12-31 C 9999-12-31
2 2016 9999-12-31 C 9999-12-31
I try to create col E based on A-D via window functions. I need to calculate the max(C) without interruption of D (if it changes the next window should begin) ordered by A, B and C.
select*,max(c) over (partition by D) from table?.. next row have D='A' again?..