The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
HI everyone.
I am trying to make a list of users that have received the most reputation comments. That is not the most points (or least points) but how many total comments ocmbined they have received. I dont need help with the php just the query has stumped me. The table 'reputation' has the following fields: Code:
reputationid postid userid reputation whoadded reason dateline The field in question is 'userid' Thanks in advance |
|
#2
|
||||
|
||||
|
Try this... untested, as I have no data to test this on.
Code:
SELECT user.userid
, user.username
, counts.comments
FROM ( SELECT userid
, COUNT(*) AS comments
FROM reputation
WHERE reason IS NOT NULL
GROUP
BY userid ) AS counts
INNER
JOIN user
ON user.userid = counts.userid
ORDER
BY counts.comments DESC
LIMIT 10;
|
|
#3
|
|||
|
|||
|
Awesome, you even added the username for me!
Seems to work flawlessly Adrian, thank you so much man! |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|