Posts by week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Arqade

Q&A for passionate videogamers on all platforms

SELECT 
  datepart(week,p.CreationDate) as [date],
  Name,
  count(*) N
FROM Posts p
     join PostTypes pt on p.PostTypeId = pt.Id
     join Posts q on isnull(p.ParentId, p.Id) = q.Id
WHERE 
  p.PostTypeId in (1,2) AND 
  datepart(year, p.CreationDate) = ##year?2015##
  and p.Score >= 0 and q.Score >= ##score?0##
GROUP BY 
  datepart(week,p.CreationDate), 
  Name 
ORDER BY 
  datepart(week,p.CreationDate),
  Name

Enter Parameters

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