All my answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

All my answers on the site

Sitecore Meta

Q&A about the site for developers and end users of the Sitecore CMS and multichannel marketing software

-- All my answers
-- All my answers on the site

DECLARE @UserId int = ##UserId##
Select * from 
(SELECT 
    a.id aid,
    a.Id AS [Post Link],
    a.CreationDate AS [Date],
    CASE WHEN q.AcceptedAnswerId=a.Id THEN 'Accepted' END AS Accepted,
    CASE WHEN q.OwnerUserId=a.OwnerUserId THEN 'Self' END AS Self,
    a.Score,
    CASE WHEN q.CommunityOwnedDate IS NOT NULL THEN 'Q'
         WHEN a.CommunityOwnedDate IS NOT NULL THEN 'A' END AS CW   
FROM
    Posts q
  INNER JOIN
    Posts a ON q.Id = a.ParentId
WHERE
    a.OwnerUserId = @UserId
  AND
    a.PostTypeId = 2
)  AA 
Inner join 
(SELECT DISTINCT Question.Id as bid, Question.CreationDate, Question.ViewCount 
FROM Posts as Answers, Posts as Question 
WHERE Answers.PostTypeId = 2 
AND Answers.OwnerUserId = @UserId 
AND Question.Id = Answers.ParentId
) BB on AA.aid = BB.bid

Enter Parameters

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