What questions does Jon Skeet have a higher/lower score on than me?
Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs
-- Robusto comparison
-- What questions does Jon Skeet have a higher/lower score on than me?
declare @UserId int = ##UserId##;
with fights as (
select myAnswer.ParentId as Question,
myAnswer.Score as MyScore,
robsAnswer.Score as RobsScore
from Posts as myAnswer
inner join Posts as robsAnswer
on robsAnswer.OwnerUserId = 2303 and myAnswer.ParentId = robsAnswer.ParentId
where myAnswer.ownerUserId = @UserId and myAnswer.postTypeId = 2
when myScore > RobsScore then 'You win'
when myScore < RobsScore then 'Robusto wins'
end as 'Winner',
Question as [Post Link],
myScore as 'My score',
RobsScore as "Robs's score"