select max(comments.commentid) as tagger, comments.commentref, article.articlesubject, article.articlename, comments.commentfrom from comments LEFT JOIN article ON comments.commentref=article.articleid GROUP BY commentref ORDER by tagger DESC;

I have this query above.

I lists comments in order from the most active to the least active from articles.

The "comments" returns might be

54 34
53 89
52 32

My problem is, I need another field from that comments table that is returned with the "max". There poster's name is commentfrom, and the query is returning the FIRST poster for all the comments related to that specific article, not the "last" poster.

Any ideas?




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to