Consecutive date grouping and find the largest number of consecutive group

Hi all

I have given dates and I want to find the largest number of consecutive dates

WIN_DATE_DATA

2015-09-22

2015-09-23

2015-09-27

2015-09-28

2015-09-29

2015-09-30

2015-10-1


In this example, there are 2 group of consecutive dates

Group 1

2015-09-22

2015-09-23

Group 2

2015-09-27

2015-09-28

2015-09-29

2015-09-30

2015-10-1


The OUTPUT should 5 which is the largest grouping of consecutive number.


Thanks in advance for the help!




Please take a look at the Community document: 101 PL/SQL: grouping sequence ranges (method Tabibitosan)

will allow you to do.

Tags: Database

Similar Questions

Maybe you are looking for