A user's non-CW answers which are highest-voted in the thread, excluding those which are the only answers to a question. Inspired by http://meta.stackoverflow.com/questions/103268/should-there-be-a-dependable-badge
Q&A for professional and enthusiast programmers
-- Dependability -- A user's non-CW answers which are highest-voted in the thread, excluding those which are the only answers to a question. -- Inspired by http://meta.stackoverflow.com/questions/103268/should-there-be-a-dependable-badge -- Post types declare @question_type int = 1 declare @answer_type int = 2 select a.Id as [Post Link] from Posts as a inner join Posts as q on q.Id = a.ParentId where q.PostTypeId = @question_type and a.PostTypeId = @answer_type and a.OwnerUserId = ##UserID## and q.CommunityOwnedDate is null and -- not CW q.AnswerCount > 1 and -- not the only answer a.Score > (select max(s.Score) from Posts as s -- sibling answers where s.Id != a.Id and s.ParentId = a.ParentId)