shlomo-test

1

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

;WITH main AS
(
SELECT qstn.Title,
       ansr.Score,
       ansr.CreationDate,
       ansr.Id AS [AnswerId],
       IIF(qstn.AcceptedAnswerId = ansr.Id, 1, 0) AS [Accepted]
FROM   Posts ansr
INNER JOIN Posts qstn
        ON qstn.Id = ansr.ParentId
INNER JOIN Users who
        ON who.Id = ansr.OwnerUserId
WHERE  who.DisplayName = '##DisplayName##'
--ORDER BY ansr.CreationDate DESC;
/*
), votes AS
(
  SELECT vt.VoteTypeId,
         vt.UserId,
         vt.PostId,
         vt.CreationDate,
         vt.BountyAmount
  FROM   Votes vt
  INNER JOIN main
          ON main.[AnswerId] = vt.PostId
*/
)
SELECT main.*,
       vt.CreationDate AS [VoteDate],
       vt.BountyAmount,
       vtyp.Name
FROM main
INNER JOIN Votes vt
        ON vt.PostId = main.AnswerId
INNER JOIN VoteTypes vtyp
        ON vtyp.Id = vt.VoteTypeId
ORDER BY main.CreationDate DESC
--PostType -- 1 = Question, 2 = Answer
--VoteTypes -- 2 = UpMod, 3 = DownMod

Enter Parameters

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