home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.theory
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!yale.edu!ira.uka.de!Germany.EU.net!incom!arlac!markus
- From: markus@arlac.rhein-main.de (Markus Felten)
- Subject: cummulation in view columns
- Message-ID: <1993Jan24.133327.2772@arlac.rhein-main.de>
- Sender: markus@arlac.rhein-main.de
- Organization: MF
- Date: Sun, 24 Jan 1993 13:33:27 GMT
- Lines: 47
-
-
- Dear SQL Users
-
- Well this should have been simple, but
- supposed I have a table like this
-
- create table material_amount(
- material char(1),
- date datetime,
- amount float)
-
- with sample data:
-
- material date amount
- -------------------------------
- A Jan 5 1993 20
- B Jan 1 1993 200
- A Jan 1 1993 100
- A Jan 3 1993 50
- B Jan 6 1993 10
-
- How can I build a VIEW material_total with [ total = sum(amount)
- from now to date ],
- the order of rows does not matter?
-
- material_total then should look like this:
-
- material date total
- -------------------------------
- A Jan 1 1993 100
- A Jan 3 1993 150 ( 100 + 50 )
- A Jan 5 1993 170 ( 100 + 50 + 20 )
- B Jan 1 1993 200
- B Jan 6 1993 210 ( 200 + 10 )
-
- Any help would be mostly welcomed.
-
- Markus
-
- --------------------------------------------------------------------------
- Markus Felten Phone: +049 6171 59387
- Systemanalyse u. Systementwicklung
- Lange Str.59 Email:
- markus@arlac.rhein-main.de
- 6370 Oberursel (near Frankfurt a.M.)
- Germany
- --------------------------------------------------------------------------
-