Q&A about the site for gardeners and landscapers
SELECT TOP 20 p.Id as [Post Link], COUNT(v.PostId)/p.AnswerCount as RecentUpvotes, p.Score, p.ViewCount, p.AnswerCount, MAX(a.Score) As HighestAnswerScore FROM Posts as p JOIN Votes v ON v.PostId = p.Id JOIN Posts a -- Answers ON a.ParentId = p.Id AND a.PostTypeId = 2 -- Only Answers WHERE v.VoteTypeId = 2 -- Only Upvotes AND v.CreationDate > '2019-04-01' GROUP BY p.Id, p.Score, p.ViewCount, p.AnswerCount HAVING MAX(a.Score) < 3 ORDER BY RecentUpvotes DESC