with upvoted as ( select posts.Id as PostId from posts i...

0

Please login or register to vote for this query.

(click on this box to dismiss)

GenAI Meta

Q&A for GenAI enthusiasts and practitioners and those interested in learning more about using GenAI tools

-- Enter Query Title
-- Enter Query Description

with upvoted as (
select
  posts.Id as PostId
from
  posts inner join
  votes on posts.Id = votes.PostId
where votes.VoteTypeId = 2 -- upvotes
  and posts.PostTypeId = 2 -- answers
group by posts.Id
)

select
  users.Id,
  count(posts.Id) as [Posts],
  count(upvoted.PostId) as [Upvoted Posts],
  count(upvoted.PostId) * 100.0 / count(posts.Id) as [Upvoted %]
from
  users   left outer join
  posts   on users.Id = posts.OwnerUserId
          left outer join
  upvoted on posts.Id = upvoted.PostId
where
  posts.PostTypeId = 2
group by users.Id
having count(posts.Id) >= 5
--order by [Upvoted %] desc;

Enter Parameters

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