|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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... Matt |
|
#2
|
|||
|
|||
|
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.. ------------------ SnR Graphics, Low Cost Hosting and Web Development. |
|
#3
|
|||
|
|||
|
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...
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Counting across a row... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|