User drop-off with reputation

0

Please login or register to vote for this query.

(click on this box to dismiss)

Non-returning users per month as a function of reputation.

Robotics

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 MonthsSinceSeen, count(Users5000.Id) as [Count5000], count(Users6000.Id) as [Count6000]
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,Users5000.LastAccessDate,GETDATE()) = #Temp.month and Users5000.Reputation between 6000 and 6999
group by #Temp.month
--select Year(LastAccessDate), Month(LastAccessDate), count(*) from Users
--where reputation between 5000 and 6000
--group by Year(LastAccessDate), Month(LastAccessDate)
--Order by Year(LastAccessDate) desc, Month(LastAccessDate) desc

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results