with top_posts as ( select ROW_NUMBER() OVER(ORDER BY Vie...

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 top_posts as (
select 
     ROW_NUMBER() OVER(ORDER BY ViewCount desc) AS rn
    ,id
    ,ViewCount
    from posts p    )
Select t.rn,p.* from posts p 
Left Join top_posts t on p.id = t.id and t.rn <=200000
where t.rn > 150000 and t.rn <=200000
order by 1

Enter Parameters

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