select * from ( select t.Id ,t.OwnerUserId,t.Score,t.Title,

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

--Show the top 50 ranked questions (post type) of users with badges only,
-- which were closed in September 2021.
select *
from (
select t.Id ,t.OwnerUserId,t.Score,t.Title,
dense_rank() over(
 order by t.Score desc
) as rank_id 
from (
select Id ,OwnerUserId, Score,Title 
from Posts p
where PostTypeId = 1 and 
ClosedDate >= '2021-09-01 00:00:00'
and ClosedDate < '2021-10-01 00:00:00'  ) as t
inner join
(select distinct UserId 
from Badges) as b 
on t.OwnerUserId = b.UserId ) as t2
where t2.rank_id <= 50

Enter Parameters

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