Preguntas con respuestas no aceptadas y con puntaje <= 0

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow en español

Preguntas y respuestas para programadores y profesionales de la informática

WITH Answers AS (
  SELECT ParentId AS Id, MAX(Score) AS Score
  FROM Posts
  WHERE PostTypeId = 2
  GROUP BY ParentId
)

SELECT
  format(Q.LastActivityDate,'dd/MM/yy') Activa,
  Q.Tags,
  Q.Id [Post Link],
  Q.AnswerCount "#Resp",
  Q.Score "Punt. Preg",
  A.Score "Punt. Resp"

FROM Posts Q
LEFT OUTER JOIN Answers A
  ON Q.Id = A.Id
WHERE Q.PostTypeId = 1           -- Preguntas
  AND Q.AnswerCount > 0          -- con respuestas
  AND Q.AcceptedAnswerId IS NULL -- no aceptadas
  AND Q.ClosedDate IS NULL       -- no cerradas
  AND A.Score <= 0               -- puntaje resp <= 0
ORDER BY A.Score            DESC,
         Q.Score            DESC,
         Q.LastActivityDate DESC

Enter Parameters

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