Quote:
Originally Posted by Ted S
Got it. And you're right, there is no variable for that.
Right now that data is not computed in aggregate for a user which means to pull it up for each post you would need another query (10 posts per page means 10 queries). It is of course possible to keep a tally for the user which would avoid the query it just isn't something people have asked for previously.
|
I figured so, actually it may be a little bit costy too with current mod design, as you are not updating that info in a field in user table (that would be afficient).
I needed this info:
SELECT b.userid, count( * )
FROM `helpfulanswer` a, post b
WHERE yesno >0 and a.postid = b.postid
GROUP BY b.userid
HAVING count( * ) >0
OR with usernames
SELECT c.username, count( * )
FROM `helpfulanswer` a, post b, user c
WHERE yesno >0 and a.postid = b.postid and b.userid=c.userid
GROUP BY b.userid
HAVING count( * ) >0