votes per active day (days with comments)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Writing

Q&A for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing

select
u.id as [User Link],u.reputation,u.upvotes,u.downvotes,
uc.activedays as allActiveDays,
ucr.activedays as recentActiveDays,
round(cast(u.upvotes + u.downvotes as float)/uc.activedays,2) as votesPerAllActiveDays
from
(select
userid as id, count(distinct convert(date, creationdate)) as activedays
from comments
group by userid) as uc
join
(select
userid as id, count(distinct convert(date, creationdate)) as activedays
from comments
where
year(creationdate) >= 2016
group by userid) as ucr
on uc.id = ucr.id
join users u
on u.id = uc.id
where
u.reputation > 101
and year(u.LastAccessDate) >= 2016
and ucr.activedays > 10
order by uc.activedays desc

Enter Parameters

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