I need to extract all the possible combinations of 6 unique numbers (in ascending order) from a set of 15 numbers.
Assuming the set of 15 numbers are as follows: 3, 5, 8, 14, 18, 20, 21, 27, 28, 30, 32, 33, 37, 39, 40, how can extract a list of all possible combinations of 6 numbers using t-sql
?
I also need the output of numbers to be added into a table with columns n1, n2, n3, n4 ,n5 and n6.
I have found the following questions which relate somewhat to my problem but I am finding it hard to translate the answers to fix my specific problem: