[Catalyst] Group functions in Catalyst
Dmitri Pissarenko
dmitri.pissarenko at gmail.com
Mon May 7 13:44:01 GMT 2007
Hello!
I have a table with "activities" and each of them has a certain
duration. Each activitiy is assigned to one category.
I want to create a table, in which
a) each category is shown and
b) for each category the sum of durations of its activities is shown.
In other words, I want to display the results of this query:
select SUM(duration), categories.name
FROM activities, categories
WHERE activities.categoryId = categories.id
GROUP BY activities.categoryId
ORDER BY categories.name
How can I execute this query in Catalyst and fetch the results?
TIA
Dmitri Pissarenko
More information about the Catalyst
mailing list