Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sum of different combinations in Oracle SQL

591793Jan 9 2008 — edited Jan 11 2008
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2008
Added on Jan 9 2008
7 comments
1,890 views