June 19th, 2000, 12:02 PM
Being relatively new at this, I hope that this isn't too embarassing a question :-)...
I have a table that stores the scores from a test that looks something like this;
Student Date_taken Q1 Q2 Q3 ... Q78
If the questions (Q%) are all true/false (ENUM('','T','F')), and I want to tally how many 'trues' a student recorded during a particular test, how can I write this select statment?
If I need to know how many 'trues' the student answered for Q3, Q6, Q9, etc... on a particular test, how do I write a select statement for this?
Thanks alot for any help...
June 20th, 2000, 02:26 AM
IMHO, the simplest solution would be to tally them before you record them into the db, into their own column (like no_t, no_f).
Then your query would be very quick and simple to perform. a quick for loop..
Low Cost Hosting and Web Development.
June 26th, 2000, 04:38 PM
I'm new at this too, but dbi returns the results in an array, array ref, and hash ref... you can just count the number of rows in the array, etc...