get tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla

Q&A for Joomla! administrators, users, developers and designers

SELECT
  count(*) as oneDayVoteCnt,
  a.postid,
  sum(case when a.voteTypeId = 2 then 1 else 0 end) as upVoteCnt,
  sum(case when a.voteTypeId = 3 then 1 else 0 end) as downVoteCnt
  from votes a
  left join posts b
  on a.PostId = b.id --the question is the answer's parent
  and datediff(hour,b.creationDate,a.creationDate) <= 24
  group by a.PostId

Enter Parameters

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