SELECT /* link, tags, date, to/away, comment */ ph.PostId...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
            /*
                link, tags, date, to/away, comment
            */
            ph.PostId as [Post Link]
            , p.PostTypeId
            , [Date] = ph.CreationDate
            , [Dirctn] = CASE WHEN ph.PostHistoryTypeId = 35 THEN 'to' ELSE 'away' END
            , ph.Comment
            --'site://q/' + CAST(a.Id AS NVARCHAR) + '|Ans ' + CAST(a.Id AS NVARCHAR) AS [Answer Link]

FROM        PostHistory ph
INNER JOIN  Posts       p
ON          p.id        = ph.PostId

/*
INNER JOIN  PostTags        pt
ON          ph.PostId       = pt.PostId
INNER JOIN  Tags            t
ON          t.Id            = pt.TagId
*/

WHERE       ph.PostHistoryTypeId in (35, 36)
--    AND p.PostTypeId != 1
and  ph.PostId = 406760

Enter Parameters

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