I have a table of 7,349 test questions in a table ("MainBank"). One
field ("QuestionCode") is used for categorizing the questions into 49
different categories. QuestionCode is required, 12 alphanumeric
characters, keyed, and unique. The first nine characters are the
category (always letters), and the last three are digits 001 to however
many questions there are in that category.
I am trying to create a report telling me how many questions of each
category I have. The following SQL statement gives me a list of the 49
categories:
SELECT DISTINCT ( SUBSTR( "QuestionCode", 1, 9 ) ) FROM "MainBank"
ORDER BY ( SUBSTR( "QuestionCode", 1, 9 ) )
So far so good. Now I need the number of questions in each category,
and that is what has me stumped. I tried adding COUNT as follows:
SELECT DISTINCT COUNT ( SUBSTR( "QuestionCode", 1, 9 ) ) FROM
"MainBank" ORDER BY ( SUBSTR( "QuestionCode", 1, 9 ) )
But that just returns the number 7,349. I need the individual count for
each category, and I can't figure out the syntax to accomplish this.
Any suggestions welcome!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]