Trending Users: All Votes vs Votes for recent content

0

Please login or register to vote for this query.

(click on this box to dismiss)

Draft SQL for statistics for http://meta.stackoverflow.com/questions/134614

Moderators

Q&A for community managers, administrators, and moderators

select v.creationDate VoteCreated, vt.name, p.id, p.creationDate PostCreated, DATEDIFF(ww, p.creationDate, v.creationDate) WeeksBetweenInitialContentAndVote
from posts p, votes v, votetypes vt
where v.postId = p.id
and v.votetypeid = vt.id
and p.owneruserid = 22656
and v.creationDate >= '2012-05-01'
and v.creationDate <= '2012-05-31'
and p.creationDate >= '2012-05-01'
and p.creationDate <= '2012-05-31'

-- The legend that is Jon Skeet: UserId = 22656
-- Jon Skeet 751 rows for votes received in May
-- Jon Skeet 290 rows for votes related to posts posted in May

-- 1=Question 2=Answer
--select *
--from posttypes

-- 1=AcceptedByOriginator, 2=UpMod, 3=DownMod
--select * 
--from voteTypes

Enter Parameters

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