Top Users by Country

0

Please login or register to vote for this query.

(click on this box to dismiss)

Created by samliew (http://stackoverflow.com/users/584192/samuel-liew)

CiviCRM

Q&A for administrators and users of the CiviCRM Constituent Relationship Management software

select top 5
OwnerDisplayName as UserName,
sum(commentcount) as CommentCount,
sum(score) as Score
from
    Posts post
    
LEFT JOIN users u on u.id = post.owneruserid
where
    LOWER(post.ownerdisplayname) LIKE LOWER('%##UserName##%')
group by score, post.ownerdisplayname
order by score desc;

Enter Parameters

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