Forums

This topic is locked

Count Query

Posted 26 Jun 2003 22:39:01
1
has voted
26 Jun 2003 22:39:01 Perry Gascoine posted:
I have built a questionnaire that has 30 questions. Each question has 4 possible answer (1, 2, 3, 4).

I need to produce a report that shows how many people answered question 1 with answer 1, question 1 with answer 2, question 1 with answer 3, question 1 with answer 4. This needs to be recreated for all 30 questions.

The following SQL will do it individually, but this would require 120 queries (30 questions * 4 answers). This would also require the same amount of recordsets.

SELECT Count(comms) AS Expr1

FROM june03

HAVING comms = 2

Does anyone know of a quicker and shorter way of doing this?

Cheers

Perry

....It's only easy if you know the answer

Replies

Replied 27 Jun 2003 10:57:22
27 Jun 2003 10:57:22 Julio Taylor replied:
select count(comms) from june03 group by comms

------------------------
Julio

PHP | MySQL | DWMX

ICQ: 19735247
MSN:

Reply to this topic