Hello, I need a help with combinations. I have a data that looks like:

1 a data_1a
1 b data_1b
1 c data_1c
2 a data_2a
2 b data_2b
2 c data_2c


Is there a way to automatically make all possible combinations of deduction between members of group 1 only then of group 2 only etc? So it would look like:

data_1a-data_1b
data_1a-data_1c
data_1b-data_1c
data_2a-data_2b
data_2a-data_2c
data_2b-data_2c

Combinations between letter indicators but not between number indicators.

Thank you for help in advance! BTW groups are different in size starting from 2 till 8 members. Won't this cause any troubles?