Most viewed questions with top scored answer < 3

0

Please login or register to vote for this query.

(click on this box to dismiss)

Magento

Q&A for users of the Magento e-Commerce platform

SELECT
  p.Id AS [Post Link],
  p.Score AS [Score],
  p.ViewCount AS [Views],
  p.CreationDate AS [Date],
  MAX(a.Score) AS [Top Scored Answer]
FROM Posts p
LEFT JOIN Posts a ON
  a.PostTypeId = 2 AND
  a.ParentId = p.Id
WHERE p.PostTypeId = 1
  AND p.ClosedDate IS NULL
GROUP BY p.Id, p.Score, p.ViewCount, p.CreationDate
HAVING MAX(a.Score) < 3 OR MAX(a.Score) IS NULL
ORDER BY Views DESC

Enter Parameters

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