Posts (answers/questions) of a given user with the upvotes and downvotes from anonymous feedback

1

Please login or register to vote for this query.

(click on this box to dismiss)

Quantitative Finance Meta

Q&A about the site for finance professionals and academics

SELECT
  p.Id AS [Post Link],
  p.CreationDate,
  SUM(Case When pf.VoteTypeId = 2 Then 1 Else NULL End) AS UpFeedback,
  SUM(Case When pf.VoteTypeId = 3 Then 1 Else NULL End) AS DownFeedback,
  SUM(Case pf.VoteTypeId When 2 Then 1 WHEN 3 Then -1 End) AS Score,
---2 = UpMod
---3 = DownMod
  p.ViewCount,
  CASE 
    WHEN p.PostTypeid=1 THEN 'Question' 
    WHEN p.PostTypeId=2 THEN 'Answer'
  END,
  p.Tags
FROM Posts p LEFT OUTER JOIN PostFeedback pf ON pf.PostId=p.Id
WHERE (p.OwnerUserId=##userid##) 
  AND (p.PostTypeId IN (##types?1,2##))
---1=answers
---2=questions
---1,2 both
GROUP By p.Id, p.CreationDate, p.Score, p.ViewCount, p.PostTypeid, p.Tags
ORDER BY p.CreationDate

Enter Parameters

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