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!

Count columns

SainaaOct 27 2020 — edited Oct 27 2020

Hello I have a list of columns with different channels and total counts.
Total counts = channel 1 count + channel 2 count .... etc
What I want to do is I want to count columns with values higher than 0 meaning
tot_cnt(10) = 0 + 0 +2 +3 +0 +5 + 0
It should count 3 be this user used 3 kind of channels.
Now second problem is I want to divide tot_cnt with total channels used meaning
10/3 = 3~4
Now I want to find users with similar average on all the channels meaning
user with 0+ 0 +0 +3 + 3 + 4 + 0 qualifies while
user with 0 + 5 + 1 + 4 + 0 + 0 +0 disqualifies because difference is too big.
Screenshot 2020-10-26 173839.png

This post has been answered by Frank Kulash on Oct 27 2020
Jump to Answer
Comments
Post Details
Added on Oct 27 2020
1 comment
100 views