declare @UserId int = ##UserId##; with fights as ( selec...


Please login or register to vote for this query.

(click on this box to dismiss)

Game Development Meta

Q&A about the site for professional and independent game developers

declare @UserId int = ##UserId##;

with fights as (
  select myAnswer.ParentId as Question,
   myAnswer.Score as MyScore,
   jonsAnswer.Score as JonsScore
  from Posts as myAnswer
  inner join Posts as jonsAnswer
   on jonsAnswer.OwnerUserId = 449 and myAnswer.ParentId = jonsAnswer.ParentId
  where myAnswer.ownerUserId = @UserId and myAnswer.postTypeId = 2

   when myScore > JonsScore then 'You win'
   when myScore < JonsScore then 'Jon wins'
   else 'Tie'
  end as 'Winner',
  Question as [Post Link],
  myScore as 'My score',
  jonsScore as "Jon's score"
from fights;

Enter Parameters

Switch to main site
loading Hold tight while we fetch your results