I am trying to solve a problem of how to find the maximum count of consecutive years in a series of records. In the following example:
ID Year 1 1993 1 1994 1 1995 1 1995 1 2001 1 2002 2 1993 2 1995 2 1996 2 1996 2 1998 2 1999 2 2000 2 2001 2 2001
My result set should look like
id count 1 3 2 4
I have to write the code in oracle SQL.