Question 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

The following query displays select fields from the Users table. Modify the query to display the users ordered by decreasing reputation.

Skeptics

Q&A for scientific skepticism

select * 
from
(
select id,
      OwnerUserId,
      rank() OVER(PARTITION BY OwnerUserId order by CreationDate asc) as promo_level
from posts
where OwnerUserId in 
(select id as OwnerUserId from users 
where CreationDate < CONVERT(date, dateadd(year, -2, getdate()))
)
and OwnerUserId != -1
 
) t
where promo_level = 10 or promo_level = 100 or promo_level = 1000
;

Enter Parameters

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