What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 129 Stack Exchange communities.

I'm trying to write a query to see who are the Top 50 biggest "askers" (ask the most questions) on StackOverflow, and how many questions they've asked. My best attempt (which throws an error), which I know is wrong, is:

SELECT
    Users.Id, sum(Posts.Id)
FROM
    Users u
    INNER JOIN
    Posts p

    ON
    u.Id = p.Id
WHERE
    max(p)

Any ideas?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Why invent the wheel twice?! Use an existing query

SELECT TOP 50
  OwnerUserId as [User Link],
  COUNT(*) as PostCount,
  SUM(Score) as TotalScore
FROM Posts
WHERE PostTypeId=1 AND OwnerUserId != 1
GROUP BY OwnerUserId
ORDER BY COUNT(*) DESC
share|improve this answer
    
"Why invent the wheel twice?" So that we can have two wheels and encourage competition in the market and drive innovation. –  uɐɯsO uɐɥʇɐN Mar 3 '13 at 23:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .