I would like to make pairs out of X number of database objects.
- Order of pairs does not matter.
- Pairs will be made over multiple rounds.
- I do not want pairs to be repeated in a subsequent round.
If I have:
A
B
C
D
The first round might be:
AB
CD
Second round might be:
AD
CB
Third round might be:
AC
DB
And there would be no other possibilities.
So for 4 elements, I could do 3 rounds before I have to repeat a pair.
What is the formula to help me with this for any number of elements?
Related How do I get the total number of unique pairs of a set in the database?