You are reading a single comment by @dst2 and its replies. Click here to read the full conversation.
  • The subjects might have had more than one occurrence unfortunately.

    The only way I can think to group them is to reference the row below.

    I could potentially use a for loop with this logic.

    Counter =0
    For i in number_of_rows:
      If enddate[i]+1 = startdate [i+1]:
        grp_num[i] = n
      elif:
        num = num+1
        grp_num[i] = num
    

    Any issues with doing loops in SQL? Will it kill everything?

About

Avatar for dst2 @dst2 started