Q&A for designers and implementers of computer programming languages
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 )