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 ##TopCount:INT?100## -- optional 100 -- Columns ROW_NUMBER() OVER (ORDER BY q.ViewCount DESC) AS #, q.Id AS [Post Link], qu.Id AS [User Link], q.CreationDate AS Created, q.ViewCount AS Views, q.AnswerCount AS AC, q.AcceptedAnswerId AS AID, a.Id AS MID, q.Score AS QS, a.Score AS MS, q.CommentCount AS QC, a.CommentCount AS MC, q.Tags FROM Posts a -- my answers JOIN Posts q ON a.ParentID=q.Id -- my answers' questions JOIN Users qu ON q.OwnerUserId=qu.Id -- questions' users WHERE a.OwnerUserId=@UserId ORDER BY Views DESC, Created DESC, MS DESC, QS DESC