Hi from the following table
id event
1 unknown
1 unknown
1 unknown
2 unknown
2 X
2 Y
3 unknown
3 unknown
4 X
5 Y
i want count all the amount of users which in all of their rows has unknown values
In this case they should be 2 ids out of 5
My attempt was :
select
count(distinct case when event != 'unknown' then id else null end) as loggeds,
count(distinct case when event = 'unknown' then id else null end) as not_log_android,
count(distinct event) as session_long
from table
but is completly wrong