how many users total, lastYear, last2months and last month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts Meta

Q&A about the site for enthusiasts and power users of the Android operating system

select count(u.Id) as "total users", 
count(case when u.LastAccessDate > '01-14-2018' then 1 else null end) as lastYear, 
count(case when u.LastAccessDate > '11-14-2018' then 1 else null end) as last2Months, 
count(case when u.LastAccessDate > '12-14-2018' then 1 else null end) as lastMonth, 
sum(u.UpVotes) as "total upvotes", sum(u.DownVotes) as "total downvotes" 
FROM Users u

Enter Parameters

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