SELECT Posts.CreationDate, Posts.Score, avg(posts_week.sc...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT 
Posts.CreationDate, Posts.Score, avg(posts_week.score)
FROM Posts 
JOIN Posts as posts_week
on posts_week.CreationDate
     between dateadd(day, -6, Posts.CreationDate) and Posts.CreationDate
WHERE Posts.PostTypeId = 2 AND Posts.CreationDate > '2020-01-01' AND Posts.Score > 0
GROUP BY Posts.CreationDate, Posts.Score
ORDER BY Posts.CreationDate

Enter Parameters

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