ja,

Your question is a little cryptic. If a questionid column value identifies a particular question, and a vote column value contains a user's vote (1,2,3, &c), can't you just write...

SELECT questionid, vote,count(vote)
FROM ...
GROUP BY questionid, vote

PB

-----

[EMAIL PROTECTED] wrote:

I have a table of votes with four fields, a primary key, and userID, that are just there for tracking purposes. But then I have questionID and vote fields. For each question, a user could pick a number of it's importance from 1 to 5. That number is what gets stored in the vote field.
So, now I want to tabulate the votes.  I thought I could just do a count with a 
group by but that isn't working.  What I want to do is for each question, get a 
count of how many ones, how many twos, how many threes, etc.

Advice?

--ja




--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/146 - Release Date: 10/21/2005


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

Reply via email to