All my answers on the site
Q&A for those who study, teach, research and apply economics and econometrics
-- All my answers -- All my answers on the site DECLARE @UserId int = ##UserId## SELECT a.Id AS [Post Link], 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 ORDER BY a.Score DESC, a.CreationDate DESC