|
Author
|
Topic: Query question - difficult or am I dumb?
|
nils.hulth Junior Member
|
posted June 22, 2000 08:14 AM
Hi,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: Score Frequency 0 4.5% 1-3 6.8% 4-6 4.2% . . . . 64-66 0.7% Is this possible to do within a single query, or do I need another helping table with the ranges? Any help appreciated! /Nils
|
pwluky Member
|
posted June 22, 2000 08:21 AM
Can you give the exact desciption of your table?? |
nils.hulth Junior Member
|
posted June 22, 2000 09:03 AM
quote: Originally posted by pwluky: Can you give the exact desciption of your table??
It's simple, just an ID and a score column. |
rod k Member
|
posted June 22, 2000 11:23 AM
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. |
nils.hulth Junior Member
|
posted June 22, 2000 01: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. |
rod k Member
|
posted June 22, 2000 02: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. |