OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
how to select total votes for each comment?

From: Patrick Aljord (patcitogmail.com)
Date: Tue Mar 04 2008 - 21:05:38 CST


Hey all,
I have comments(id,content) and votes(comment_id,vote). vote is a tinyint.

I would like to select total votes for each comment, I tried:

 "select content, sum(v.votes) from comments c left join votes v on
c.id=v.comment_id"

but it only returns first result obviously, any idea how I could do this?

Thanks in advance,

Pat

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql