From: | Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> |
---|---|
To: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | Edwin Quijada <listas_quijada(at)hotmail(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: Funciones windows 8.4 |
Date: | 2009-07-07 05:31:28 |
Message-ID: | 3073cc9b0907062231o4f60ee19o6275859574a94ed@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
2009/7/2 Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>:
> 2009/7/1 Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>:
>
>> FA | 12332 | -6.00 | 106.00
>> FA | 12334 | -10.00 | 106.00
>> FA | 12369 | -40.00 | 56.00
>> FA | 12390 | -10.00 | 56.00
>
> Ja! chequeando esto me acorde que cuando el valor que ponemos en la
> clausula OVER (en este caso OVER (order by fecha)) se repite para esos
> casos no acumula...
doh!! la solucion era tan simple!!!
en lugar de OVER (order by fecha) uso OVER (order by fecha, tipo, numero)
select tipo, numero, cantidad, sum(cantidad) over (order by fecha, tipo, numero)
from (select tipo, numero, cantidad * (-1) as cantidad, fecha::date
from fcmovinv
where producto = 'PAR00056'
and fecha::date between '2009-06-01'::date and '2009-06-30'::date
UNION ALL select 'SI', 0, 200, '2009-05-31'::date) as foo
order by fecha, tipo, numero;
--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157
From | Date | Subject | |
---|---|---|---|
Next Message | Jaime Casanova | 2009-07-07 05:46:49 | Re: Funciones windows 8.4 |
Previous Message | hcalmur | 2009-07-07 03:12:12 | hi |