logo       

Re: [sqlite] Subtotal SQL: msg#00814

sqlite-users

Subject: Re: [sqlite] Subtotal SQL

On Wed, 29 Jul 2009, Adler, Eliedaat wrote:

> SQL/sqlite challenge for all:

No challenge for anyone who knows SQL.

> I need a running sum of size that works regardless of what order the objects
> are in.
> User Function/Aggregates welcome!

_All_ implementations of SQL include a suite of aggregate functions, and
SUM() is among those. Take a look at the SQLite Web site, Mike Owens's book,
Rick van der Lans's book, or any introduction to SQL.

You will write, "SELECT filename, date, owner, size, SUM(size) AS total
FROM mytable;"

Rich

--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
_______________________________________________
sqlite-users mailing list
sqlite-users@xxxxxxxxxx
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise