Today I used a great analytic function : LAG. With LAG, the value of the the previous row in a query can be evaluated. In combination with CASE (or the good old DECODE) you can then make break columns in a view. Instead of writing procedural code in pl/sql or java
(define cursor, loop, compare old [...]