OVH Cloud OVH Cloud

[MySQL] Cumul de valeurs

1 réponse
Avatar
Vincent Bernat
Coucou !

Je cherche comment faire le cumul des valeurs dans une table. Par
exemple, si j'ai une requête qui me donne :

23/04/2004 15
24/04/2004 5
25/04/2004 3
26/04/2004 6

Je voudrais la modifier pour avoir :

23/04/2004 15
24/04/2004 20
25/04/2004 23
26/04/2004 29

Est-ce possible ?
--
panic("Oh boy, that early out of memory?");
2.2.16 /usr/src/linux/arch/mips/mm/init.c

1 réponse

Avatar
innovative
essai :
select distinct t.date, (select sum(t.chiffre) from table as t where
t.date<=t2.date) from table as t2 order by t.date


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.693 / Virus Database: 454 - Release Date: 01/06/2004