Hi all,

How can I get distribution of values in a field? For example, I have the 
scores below:

             (score)
(raw1)        1
(raw2)        1
(raw3)        3
(raw4)        4
(raw5)        4
(raw6)        5
(raw7)        8
(raw8)        8
(raw9)        9
(raw10)    10

I want to have a result like that: {1: 2}, {3: 1}, {4: 2}, {5: 1}, {8: 2}, 
{9: 1}, {10: 1}. So it is {score: count}.

How can I evaluate this only one db hit?

Thanks all.


--

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/301f4583-892e-4e06-b3a7-983381b95fbd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to