Votes by time from post creation

0

Please login or register to vote for this query.

(click on this box to dismiss)

What's with all the negative times?

Stack Overflow

Q&A for programmers

-- Votes by time from post creation
-- What's with all the negative times?
with times as (
select datediff(Minute, p.CreationDate, v.CreationDate) as MinutesToVote,
count(*) as VotesCount
from votes v
join posts p on p.id = v.postid
where v.VoteTypeId in (2,3)
group by datediff(Minute, p.CreationDate, v.CreationDate)
)
select * from times
order by MinutesToVote asc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached