Skip to content
Advertisement

Oracle: Analytical functions Sub totals after each change in value

I have the following data (order of records as in the example):

from SQL:

I want to group the data for each change of value in column A, I want to get the following result:

How to get such a result in the ORACLE 11. I would expect a simple implementation…

Advertisement

Answer

This is a gaps and islands problem, solved using row_number analytic function

Demo

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement