> select ... cume(daily_total) as running_total
>The syntax for your database may be different.
indeed
what database are you using, dan? i've never heard of "cume"
before, but it sure sounds useful
any examples you could share?
rudy
***********************************
I work on the data warehouse team and we have data warehouse software
instead of database software. The product name is Redbrick Warehouse, the
current owner is IBM, and it ain't cheap.
But, here is an example of how cume works with real data. Note that the
queries will not yield useful results, I just chose something with a
numeric primary key,
select service_code, service, cume(service_code)
from service where service_code between 10 and 20;
11 ALLERGY 11
12 CARDIOLOGY 23
13 DERMATOLOGY 36
14 ENDOCRINOLOGY 50
15 GASTROENTEROLOGY 65
16 NEPHROLOGY 81
17 NEUROLOGY 98
18 RESPIROLOGY 116
19 RHEUMATOLOGY 135
20 PAEDIATRICS 155
Here is a moving sum of the same data
select service_code, service, movingsum(service_code, 3)
from service where service_code between 10 and 20;
11 ALLERGY NULL
12 CARDIOLOGY NULL
13 DERMATOLOGY 36
14 ENDOCRINOLOGY 39
15 GASTROENTEROLOGY 42
16 NEPHROLOGY 45
17 NEUROLOGY 48
18 RESPIROLOGY 51
19 RHEUMATOLOGY 54
20 PAEDIATRICS 57
Or a moving average:
select service_code, service, movingavg(service_code, 2)
from service where service_code between 10 and 20;
11 ALLERGY NULL
12 CARDIOLOGY 11.5000000000
13 DERMATOLOGY 12.5000000000
14 ENDOCRINOLOGY 13.5000000000
15 GASTROENTEROLOGY 14.5000000000
16 NEPHROLOGY 15.5000000000
17 NEUROLOGY 16.5000000000
18 RESPIROLOGY 17.5000000000
19 RHEUMATOLOGY 18.5000000000
20 PAEDIATRICS 19.5000000000
Our Cold Fusion work, for the most part, concerns reporting on data that is
already there as opposed to inserting records from some sort of form input.
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: [EMAIL PROTECTED]
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)