Gordon Linoff Comparison

1

Please login or register to vote for this query.

(click on this box to dismiss)

What questions does Jon Skeet have a higher/lower score on than me?

Stack Overflow на русском Meta

Вопросы и ответы о сайте для программистов

declare @UserId int = ##UserId##;

with fights as (
  select myAnswer.ParentId as Question,
   myAnswer.Score as MyScore,
   gordonsAnswer.Score as GordonsScore
  from Posts as myAnswer
  inner join Posts as gordonsAnswer
   on gordonsAnswer.OwnerUserId = 1144035 and myAnswer.ParentId = gordonsAnswer.ParentId
  where myAnswer.ownerUserId = @UserId and myAnswer.postTypeId = 2
)

select
  case
   when myScore > gordonsScore then 'You win'
   when myScore < gordonsScore then 'Jon wins'
   else 'Tie'
  end as 'Winner',
  Question as [Post Link],
  myScore as 'My score',
  gordonsScore as 'gordons''s score'
from fights;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results