Non-returning users per month as a function of reputation.
Q&A for professional robotic engineers, hobbyists, researchers and students
-- User drop-off with reputation -- Non-returning users per month as a function of reputation. create table #Temp (month int) declare @counter int set @counter = 0 while @counter <= 20 begin insert #Temp(month) values(@counter) set @counter = @counter + 1 end --select #Temp.month as [Months Since Last Seen], count(Users5000.Id) as [Rep5000+], count(Users6000.Id) as [Rep6000+], count(Users50000.Id) as [Rep50000+] --from #Temp --left outer join Users as Users5000 on DATEDIFF (month,Users5000.LastAccessDate,GETDATE()) = #Temp.month and Users5000.Reputation between 5000 and 5999 --left outer join Users as Users6000 on DATEDIFF (month,Users6000.LastAccessDate,GETDATE()) = #Temp.month and Users6000.Reputation between 6000 and 6999 --left outer join Users as Users50000 on DATEDIFF (month,Users50000.LastAccessDate,GETDATE()) = #Temp.month and Users50000.Reputation > 50000 --group by #Temp.month select top 100 #Temp.month from #Temp left outer join Users on DATEDIFF (month,Users.LastAccessDate,GETDATE()) = #Temp.month