Usuários por mês


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow em Português

Perguntas e respostas para programadores profissionais e entusiastas

CONVERT(DATETIME, CONCAT(YEAR(CreationDate), '-', MONTH(CreationDate), '-01'), 20) AS Mes,
COUNT(*) AS UsuariosNovos,
(SELECT COUNT(*) FROM Users u WHERE YEAR(u.CreationDate) <= YEAR(Users.CreationDate) AND MONTH(u.CreationDate) <= MONTH(Users.CreationDate) ) AS Usuarios
FROM Users

GROUP BY YEAR(CreationDate), MONTH(CreationDate)
ORDER BY YEAR(CreationDate), MONTH(CreationDate)

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results