June 22nd, 2000, 10:14 AM
I have a table with thousands of assessment results in the range 0-66, that I'd like to calculate some statistics for. The format I'd like is:
Is this possible to do within a single query, or do I need another helping table with the ranges?
Any help appreciated!
June 22nd, 2000, 10:21 AM
Can you give the exact desciption of your table??
June 22nd, 2000, 11:03 AM
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by pwluky:
Can you give the exact desciption of your table??[/quote]
It's simple, just an ID and a score column.
June 22nd, 2000, 01:23 PM
select score,count(*) from table group by score;
This will return a result set where each row contains a score and the number of rows where that score is entered.
June 22nd, 2000, 03:36 PM
Yeah, I've tried that, but you see I don't want it by single scores, I want them group by intervals, like all scores between 1 and 3 counted together.
June 22nd, 2000, 04:16 PM
Then you'll have to manually add the groupings together with a script, which should be quite easy. I can't think of any possible ways to group them together like that with a single query and multiple queries wouldn't be wise from a performance standpoint.