with top5 as (select top 5 u.id, displayname, upvotes fro...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Chemistry

Q&A for scientists, academics, teachers, and students in the field of chemistry

with top5 as (select top 5 u.id, displayname, upvotes  
from users u
where u.id <> -1
order by upvotes desc)

select t.id as userID, max(p.id) as postID, max(p.creationdate) as last_post_date, sum(answercount) as answercount,owneruserid
from top5 as t
inner join posts p on p.owneruserid=t.id 
group by t.id  , owneruserid

order by 4 desc

Enter Parameters

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