Votos por Usuário com 15+ rep

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow em Português

Q&A for professional and enthusiast programmers

SELECT 
CONVERT(DATETIME, CONCAT(YEAR(CreationDate), '-', MONTH(CreationDate), '-01'), 20) AS Mes,
CONVERT(FLOAT, (SELECT COUNT(*) FROM Votes v WHERE YEAR(v.CreationDate) <= YEAR(Votes.CreationDate) AND MONTH(v.CreationDate) <= MONTH(Votes.CreationDate) AND VoteTypeId IN(2,3)) )
/(SELECT COUNT(*) FROM Users u WHERE YEAR(u.CreationDate) <= YEAR(Votes.CreationDate) AND MONTH(u.CreationDate) <= MONTH(Votes.CreationDate) AND u.Reputation > 14) AS 'Votos por Usuário com 15+ rep'
FROM Votes
WHERE VoteTypeId IN(2,3) -- Up, Down
GROUP BY YEAR(CreationDate), MONTH(CreationDate)
ORDER BY YEAR(CreationDate), MONTH(CreationDate)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results