[Zope] Summing ZSQL Column Values

abg@comco-inc.com abg@comco-inc.com
Tue, 24 Jun 2003 11:31:34 -0500


What is the most efficient method of iterating through ZSQL rows and
displaying the sum of a specific column?

For example, suppose my table looks like:

------------------
|Col1 |Col2 |Col3|
------------------
|13   |51   |90  |
------------------
|23   |45   |67  |
------------------

What's the best way to sum and display the values in Col1 using a Python
Script or DTML Method? My actual database is quite large, so efficiency is a
concern.

Thanks,

Aaron
abg@comco-inc.com