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 top 1000
  *
from (
  select
    users.Id as [User Link],
    count(posts.Id) as [Posts],
    count(upvoted.PostId) as [Upvoted Posts],
    count(upvoted.PostId) * 100.0 / count(posts.Id) as [Upvoted %],
    sum(posts.score) * 1.0 / count(posts.Id) as [Average Score]
  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
) subq
where [Posts] >= 10
order by [Upvoted %] - [Average Score]*[Average Score] desc
--[Upvoted %]/2 - [Average Score] desc, [Average Score] asc;

Enter Parameters

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