WITH AverageReputation AS ( SELECT AVG(Reputation) AS Avg...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Game Development Meta

Q&A about the site for professional and independent game developers

WITH AverageReputation AS
(
  SELECT AVG(Reputation) AS AvgRep
  FROM Users
  WHERE DisplayName IS NULL
),
AverageScores AS
(
  SELECT
    AVG(CASE WHEN p.PostTypeId = 1 THEN CAST(p.Score AS float) ELSE 0 END) AS AvgQuestionScore,
    AVG(CASE WHEN p.PostTypeId = 2 THEN CAST(p.Score AS float) ELSE 0 END) AS AvgAnswerScore
  FROM Users u
  INNER JOIN Posts p
    ON p.OwnerUserId = u.Id
  WHERE u.DisplayName IS NULL
)
SELECT *
FROM AverageReputation
CROSS JOIN AverageScores

Enter Parameters

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