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.
views:
24answers:
1
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
2010-02-27 00:59:24
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
2010-02-27 13:58:50
at least, building custom query without using views will more simpler...
Nikit
2010-02-28 01:35:50