Пользователи по количеству популярных вопросов

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

SELECT pu.OwnerUserId AS [User Link],
  pu.TotalCount,
  pu.PopularCount,
  pu.PopularCount*1.0/pu.TotalCount as PopularRatio
from 
(SELECT p.OwnerUserId,
       count(1) AS TotalCount,
       sum(CASE
               WHEN p.ViewCount>=1000 THEN 1
               ELSE 0
           END) AS PopularCount
FROM Posts p
WHERE p.PostTypeId = 1 --Questions
GROUP BY p.OwnerUserId
HAVING count(1) >= 10) pu
where pu.PopularCount>0
ORDER BY PopularRatio DESC

Enter Parameters

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