Q&A about the site for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure
DECLARE @UserId INT = ##UserId:INT## SELECT Top 30 ROW_NUMBER() OVER (ORDER BY c.Score DESC, c.CreationDate DESC) AS 'ID', c.PostID [Post Link], c.PostId, pc.Id, p.ParentId, pc.ParentId, u.DisplayName AS 'User', u.Reputation AS 'Reputation', p.Title AS 'Title', p.CommentCount AS 'Comments', IIF(pc.PostTypeId = 1, 'Q', 'A') AS 'QA', c.Score AS 'Score', c.CreationDate 'Date', c.Text AS 'Comment' FROM Comments AS c JOIN Posts AS pc ON pc.ParentId = c.PostId JOIN Posts AS p ON p.Id = c.PostId JOIN Users AS u ON u.Id = p.OwnerUserId WHERE c.UserId = @UserId ORDER BY c.Score DESC, c.CreationDate DESC