SELECT TOP 30 pq.Id as question_id, pq.AcceptedAnswerId a...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Interpersonal Skills

Q&A for people looking to improve their interpersonal communication skills

SELECT TOP 30
  pq.Id as question_id,
  pq.AcceptedAnswerId as accepted_answer_id,
  pa.Id as answer_id,
  pa2.Score as accepted_score,
  pa.score as max_score
FROM posts pq

LEFT JOIN 
  (
    SELECT * 
    FROM posts pa 
    WHERE pa.ParentId IS NOT NULL
  ) pa2 on pa2.Id = pq.AcceptedAnswerId

LEFT JOIN 
  (
    SELECT * 
    FROM posts pa 
    WHERE pa.ParentId IS NOT NULL
  ) pa on pa.ParentId = pq.Id



WHERE pq.ParentId IS NULL
ORDER BY question_id

Enter Parameters

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