Hi, I am newly start to use rails and I have a problem. score table is Name scoreA scoreB A 878 89 B 1000 98 C 1651 102 D 1045 78 E 2001 94 F 2800 112 G 3008 99 i want to have average value group by range. like this result scoreA ave_scoreB 0~1000 89 1001~2000 xx 2001~3000 xx 3001~ xx It seems that the standard GROUP BY sql does not support this. I can put the average value into temporay array by using 4 different find. Does anyone has better solution than this? many thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---