Creating Group for multiple columns with multiple duplicates
问题 The below table contains details of members and their policies. We need to form a group of 2 or more members if they have at least one policy in common. Member_ID Policy 101 X1 103 Y2 104 Z1 101 Y1 102 X1 101 X3 103 Z1 101 X2 102 Y3 105 Y1 Required result: GROUP Member_ID Policy 1 101 X1 1 101 X2 1 101 X3 1 101 Y1 1 102 X1 1 102 Y3 1 105 Y1 2 103 Y2 2 103 Z1 2 104 Z1 回答1: What you describe is a graph-walking algorithm. This is complicated because you may need to traverse multiple levels. For