Distribution of reputation on javascript

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

-- Distribución de la reputación de los usuarios que responden preguntas sobre un tema específico
DECLARE @TagName NVARCHAR(100) = 'javascript'

SELECT 
    u.Reputation AS ReputacionUsuario,
    COUNT(a.Id) AS TotalRespuestas
FROM 
    Posts p
JOIN 
    PostTags pt ON p.Id = pt.PostId
JOIN 
    Tags t ON t.Id = pt.TagId
JOIN 
    Posts a ON a.ParentId = p.Id AND a.PostTypeId = 2 -- Respuestas
JOIN 
    Users u ON a.OwnerUserId = u.Id
WHERE 
    t.TagName = @TagName
    AND p.PostTypeId = 1 -- Preguntas
GROUP BY 
    u.Reputation
ORDER BY 
    u.Reputation DESC

Enter Parameters

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