SQL Server code, if possible.
Let's say you have a table with two columns. Column 1 is named Monster and Column 2 is named Level:
Monster | Level
_______________
Small Beast | 300
Large Beast | 700
Small Dragon | 350
Large Dragon | 800
How can I query this table to get All the possible combinations of Column 1:Monster? Keep in mind that the number of monsters in the table can fluctuate.
So output would be:
Small Beast, Large Beast
Small Beast, Small Dragon
Small Beast, Large Dragon
Large Beast, Small Dragon
Large Beast, Large Dragon
Small Dragon, Small Beast, Large Beast
Large Dragon, Small Beast, Large Beast
... and so on.
I would then like to add the sum value from Column 2:Level for all monsters in the combination and output them like so:
Small Beast, Large Beast: 1000
Small Beast, Small Dragon: 650
Large Dragon, Small Beast, Large Beast: 1800
CROSS JOINsfor starters.