CV Users with most interesting answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Islam

Q&A for Muslims, experts in Islam, and those interested in learning more about Islam

-- top answers on CV
SELECT MAX(score) max_score, count(p.id) awesome_posts, 
       (select count(*) from posts p2 
       where p2.posttypeid=2 and p2.owneruserid = u.id) total_posts,
       u.reputation, u.displayname,
       REPLACE('http://stats.stackexchange.com/users/' 
        + str(u.id) + '?tab=answers&sort=votes', ' ','')  cv_userpage,
       u.age, u.location, u.websiteurl,
       lastaccessdate
FROM users u, posts p
WHERE u.id = p.owneruserid
AND p.posttypeid = 2  -- answers only
AND p.score > 20
AND p.parentid <> 1337 -- ignore jokes
AND p.parentid <> 726  -- ignore quotes
GROUP BY reputation, u.displayname,
       u.age, u.location, u.websiteurl, u.lastaccessdate, u.id
--HAVING MAX(score)> 30  -- instead of counting all posts, let's just count the best ones.
ORDER BY awesome_posts desc

Enter Parameters

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