With repPerPostUser as ( SELECT u.id, CAST (u.Reputation ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Space Exploration

Q&A for spacecraft operators, scientists, engineers, and enthusiasts

With repPerPostUser as
(
  SELECT 
      u.id,
      CAST (u.Reputation as decimal(15,5)) / 
        CAST (CASE 
                WHEN COUNT(p.id) = 0 THEN 1 
                ELSE COUNT(p.id) 
                END AS decimal(15,5)) RepPerPost
              
          

  FROM
    users u
    INNER JOIN posts p
    ON u.id = p.OwnerUserId
  GROUP BY
    u.id, u.reputation
)
SELECT TOP 10
  id [User Link] , RepPerPost
FROM
  repPerPostUser
order by RepPerPost desc

Enter Parameters

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