users by rep, LastAccessDate and posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with aleastonepostusers as (select LastAccessDate, Reputation, COUNT(*) as 'count' from Users u
JOIN posts p
ON p.owneruserid = u.id
GROUP BY u.id, u.LastAccessDate, u.Reputation
HAVING COUNT(*) >= 1)

(select 'users below 15 rep', count(*) from aleastonepostusers
where DATEDIFF(DAY, LastAccessDate, cast('2015-10-06' as datetime)) < 0
and Reputation < 15
)
union
(
select 'users at or above 15 rep', count(*) from aleastonepostusers
where DATEDIFF(DAY, LastAccessDate, cast('2015-10-06' as datetime)) < 0
and Reputation >= 15
)

Enter Parameters

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