>> I want to do, as the subject suggests, a top N values per group query >> and I was wondering if there was a way to do it "The Ruby Way" as >> opposed to writing a complicated find_by_sql or some such.
That's exactly the kind of thing that I'd argue makes SQL such a great language, actually -- it's possible to express this kind of query in just a few lines. (=
I tend to agree with Sam here. The database is likely going to be able to do this grouping for you much more quickly than you could writing it in ruby. While I appreciate ruby purism, /most/ the time I would prefer an efficient application to a "pure" one. But, each application is different and maybe your priorities are different than mine.
-- Caleb Phillips _______________________________________________ PDXRuby mailing list [email protected] IRC: #pdx.rb on irc.freenode.net http://lists.pdxruby.org/mailman/listinfo/pdxruby
