Forum Stats

  • 3,723,932 Users
  • 2,244,654 Discussions
  • 7,850,763 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Count columns

Sainaa
Sainaa Member Posts: 132 Green Ribbon
edited October 2020 in SQL & PL/SQL

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.


Best Answer

Answers

Sign In or Register to comment.