views:

24

answers:

1

I'm using Drupal's Views 2, and need to retrieve min values from fields in a custom table. The query for this is easy if I were writing it by hand--something like, "SELECT foo, min(bar) FROM table GROUP BY foo." But how would I do this using Views? I've already defined the table in a views.info file, so there's no trouble getting views to see the table. It's the Min() part of the query I just don't understand.

My next stop will be the Views API documentation, but if someone can just provide the outline for how to do this quickly, I would greatly appreciate it.

A: 

There's modules http://drupal.org/project/views_groupby and http://drupal.org/project/views_calc, but i assume it is not acceptible for you.
You can make it in custom module: http://groups.drupal.org/node/21576

Nikit
Thanks! Neither of those modules really did the trick. (Group by is good, but views calc is more of a style plug in.) I saw that discussion, too, and will probably go that direction, but man, that's a lot of work to get MIN into a query. Any other clues greatly appreciated.
silkyD
at least, building custom query without using views will more simpler...
Nikit

related questions