Tasa de respuestas efectivas html

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematica Meta

Q&A about the site for users of Wolfram Mathematica

-- Tasa de respuestas efectivas (altos votos o aceptadas)
DECLARE @TagName NVARCHAR(100) = 'html'
DECLARE @MinVotos INT = 5 -- Define el umbral de "altos votos"

SELECT 
    COUNT(DISTINCT a.Id) AS RespuestasTotales,
    COUNT(CASE WHEN a.Score >= @MinVotos THEN 1 END) AS RespuestasConAltosVotos,
    COUNT(CASE WHEN p.AcceptedAnswerId = a.Id THEN 1 END) AS RespuestasAceptadas,
    ROUND((COUNT(CASE WHEN a.Score >= @MinVotos THEN 1 END) * 100.0) / COUNT(a.Id), 2) AS PorcentajeAltosVotos,
    ROUND((COUNT(CASE WHEN p.AcceptedAnswerId = a.Id THEN 1 END) * 100.0) / COUNT(a.Id), 2) AS PorcentajeRespuestasAceptadas
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
WHERE 
    t.TagName = @TagName
    AND p.PostTypeId = 1 -- Preguntas

Enter Parameters

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