WITH Questions AS ( SELECT COUNT(*) as qcount, Posts.Owne...

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

WITH Questions AS (
  SELECT
    COUNT(*) as qcount,
    Posts.OwnerUserId as UserId
  FROM Posts
  WHERE
    PostTypeId = 1
  GROUP BY
    Posts.OwnerUserId
)

SELECT
  Questions.qcount as 'Number of Questions',
  100 * Questions.qcount / (SELECT COUNT(*) FROM Questions) as '% of Questions',
  Users.DisplayName as 'User'
FROM
  Questions
  INNER JOIN
    Users
    ON
      Questions.UserId = Users.Id
ORDER BY
  Questions.qcount
    DESC

Enter Parameters

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