with ranked_score_per_user as (select row_number() over...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Iota Meta

Q&A about the site for users of Iota, the open-source cryptocurrency for IoT that does not use a blockchain

--section 8- 8.	Find the posts which were “active” for longer than 100 days
--(a post is “active” in the time period after its creation and before it is being
--closed). For each user who owns at least one post as mentioned above,
--display the posts which received the top 3 scores.

--select OwnerUserId,CreationDate,ClosedDate from posts
--where ClosedDate-CreationDate > 100;

with ranked_score_per_user as (select row_number() over(
 partition by OwnerUserId 
 order by Score desc) as 'post_score_rank',
Id,OwnerUserId,CreationDate,ClosedDate,score from posts
where OwnerUserId in (
 select distinct top (100) OwnerUserId from posts
 where ClosedDate-CreationDate > 100))
select * from ranked_score_per_user
where post_score_rank <= 3;

Enter Parameters

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