An epic battle, copied from Query #1596.
Q&A about the site for people organizing, marketing or licensing open source development projects
with fights as ( select HerbertsAnswer.ParentId as Question, HerbertsAnswer.Score as HerbertsScore, egregsAnswer.Score as egregsScore from Posts as HerbertsAnswer inner join Posts as egregsAnswer on egregsAnswer.OwnerUserId = 4427 and HerbertsAnswer.ParentId = egregsAnswer.ParentId where HerbertsAnswer.ownerUserId = 2478 and HerbertsAnswer.postTypeId = 2 ) select case when HerbertsScore > egregsScore then 'Herbert wins' when HerbertsScore < egregsScore then 'egreg wins' else 'Tie' end as 'Winner', Question as [Post Link], HerbertsScore as "Herbert's score", egregsScore as "egreg's score" from fights;