Q&A for anime and manga fans
-- UserId: User ID DECLARE @UserId int = ##UserId:int##; SELECT DISTINCT answers.Id as [Post Link], v.VoteTypeId FROM PostsWithDeleted as questions INNER JOIN PostsWithDeleted as answers ON answers.ParentId = questions.Id LEFT OUTER JOIN PostLinks pl on pl.PostId = questions.Id LEFT OUTER JOIN Votes v on v.PostId = questions.Id WHERE answers.OwnerUserId = @UserId AND questions.ClosedDate IS NOT NULL AND pl.LinkTypeId = 3 AND v.UserId = @UserId -- answers.OwnerUserId ORDER BY answers.Id DESC ;