Jon Skeet comparison

0

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?

Software Quality Assurance and Testing Meta

Q&A about the site for software quality control experts, automation engineers, and software testers

DECLARE @UserId int = ##UserId##;

WITH fights AS (
	SELECT y.ParentId
		  ,y.Score AS yScore
	  	,j.Score AS jScore
		  ,CASE 
		      WHEN j.AcceptedAnswerId = y.OwnerUserId THEN 'You'
		      WHEN j.AcceptedAnswerId = j.OwnerUserId THEN 'Jon'
		      WHEN j.AcceptedAnswerId IS NULL         THEN 'open'
		      ELSE                                         'other'
		   END AS acc
	FROM   Posts AS j
	JOIN   Posts AS y ON y.ParentId = j.ParentId
	WHERE  j.OwnerUserId = 905902
	AND    y.OwnerUserId = @UserId
	AND    y.postTypeId  = 2
	)
SELECT ParentId AS [Post]
	  ,CASE
	      WHEN yScore > jScore THEN 'You'
	      WHEN yScore < jScore THEN 'Jon'
	      ELSE                      'Tie'
	   END AS [UpvoteWinner]
	  ,acc    AS [Accepted Answer]
	  ,yScore AS [Your Upvotes]
	  ,jScore AS [Jons Upvotes]
FROM   fights
ORDER  BY ParentId

Enter Parameters

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