SET STATISTICS IO ON ;WITH RankedQuestions AS ( SELECT T...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- select all questions that are ranked #1 in order of score, 
-- highest-to-lowest

SET STATISTICS IO ON ;WITH RankedQuestions AS (
  SELECT Title, CreationDate, OwnerDisplayName,
  RANK() OVER (ORDER BY Score Desc) AS ScoreRank
  FROM Posts
  WHERE PostTypeId = 1
  )
SELECT Title, CreationDate, OwnerDisplayName
FROM RankedQuestions
WHERE ScoreRank = 1;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results