select * from ( select OwnerUserId,Title, Score, dense_ra...

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 *
from (
    select OwnerUserId,Title, Score,
    dense_rank() over(
     order by Score desc
    ) as rank_id
    from Posts p
    where
     PostTypeId = 1 
    and ClosedDate >= '2021-09-01 00:00:00'
    and ClosedDate < '2021-10-01 00:00:00'  
     and exists (select 1 from Badges b where b.UserId = p.OwnerUserId )
   ) as t 
 where t.rank_id <= 50

Enter Parameters

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