SELECT p.Id , p.PostTypeId , p.AcceptedAnswerId , p.Paren...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

SELECT
    p.Id
  , p.PostTypeId
  , p.AcceptedAnswerId
  , p.ParentId
  , p.Score
  , p.ViewCount
  , p.OwnerUserId
  , p.Body
  , ( SELECT
          COUNT(1)
      FROM
          Votes v
      WHERE
          v.PostId = p.Id
      AND v.VoteTypeId = 2
    ) AS upvotes
  , ( SELECT
          COUNT(1)
      FROM
          Votes v
      WHERE
          v.PostId = p.Id
      AND v.VoteTypeId = 3
    ) AS downvotes
FROM
    Posts p
WHERE
  (  p.ParentId = 337843
  OR p.Id = 337843
  )

Enter Parameters

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