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!

How to get all possible combination of multiple columns to aggregate

918103Sep 13 2018 — edited Sep 14 2018

Hello,

I have a table with structure

account

var1

var2

var3

var4

var5

var6

var7

var8

var9

var10

The output I am looking as below. the sample is based on the table with 3 vars. The number of variables can increase.

kpi                     count of acounts

-------------------------------------------------

var1                              10

var2                                8

var3                                7

var1+var2                      12

var1+var3                       15

var2+var3                      12

var1+var2+var3              1

Thank you in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2018
Added on Sep 13 2018
9 comments
2,121 views