Test of Interface

0

Please login or register to vote for this query.

(click on this box to dismiss)

Earth Science

Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences

with comment_count as (
select 
  UserId
  ,count(Id) count_comments
from 
  Comments
group by
  UserId
)
  
, post_count as (
select
  OwnerUserId
  ,count(a.id) count_posts
from 
  Posts a
group by
  OwnerUserId
)

select
  coalesce(a.OwnerUserId, UserId) UserId
  ,count_posts + count_comments as total_count
from
  post_count a
full join
  comment_count b on a.OwnerUserId = b.UserId

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results