Sum of different combinations in Oracle SQL
591793Jan 9 2008 — edited Jan 11 2008Hello All,
I was trying to do Sum of different combinations using oracle SQL. To describe it little more ...
Lates say I have 4 values as :
A,B,C,D ( It could be any number of values...I just chose 4 here as an example)
Then the different combinations I will have are :
A
AB
AC
AD
ABC
ABD
ACD
ABCD
B
BC
BD
BCD
C
CD
D
in nutshell it will be sum of different possible combinations ( 4C1 + 4C2 + 4C3 + 4C4 = 15 )
I am not sure as to how to achieve it using SQL ...I will appreciate if anyone can provide help with this....or pointers on the same.
Pelase let me know if I have missed on something. Thanks in advance,
Sam