below is my query :
select (
case when activity_type=3 then 'share_count_secret'
when activity_type=4 then 'download_count_secret'
when activity_type=5 then 'copy_count_secret' end
)as activity_type ,
count(distinct user_account_id_fk) as counts
from activities
where target_id = 522556
and activity_type in(3,4,5)
group by activity_type;
below is the output of above query:
activity_type counts
share_count 2
download_count 2
but I want output like:
share_count download_count
2 2