From: | Edwin Quijada <listas_quijada(at)hotmail(dot)com> |
---|---|
To: | <jcasanov(at)systemguards(dot)com(dot)ec>, <alvherre(at)alvh(dot)no-ip(dot)org> |
Cc: | <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | RE: Funciones windows 8.4 |
Date: | 2009-07-07 19:02:53 |
Message-ID: | BLU137-W29A9410AEAB87F10615568E3280@phx.gbl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
La verdad que esto esta en chino para mi. Tendre qe volver aprender. Alguien se anima hacer un webcast explicando las funciones windows. Me lei la presentacion en PgExpert pero falta mas.
*-------------------------------------------------------*
*-Edwin Quijada
*-Developer DataBase
*-JQ Microsistemas
*-Soporte PostgreSQL
*-www.jqmicrosistemas.com
*-809-849-8087
*-------------------------------------------------------*
----------------------------------------
> From: jcasanov(at)systemguards(dot)com(dot)ec
> Date: Tue, 7 Jul 2009 00:46:49 -0500
> Subject: Re: [pgsql-es-ayuda] Funciones windows 8.4
> To: alvherre(at)alvh(dot)no-ip(dot)org
> CC: listas_quijada(at)hotmail(dot)com; pgsql-es-ayuda(at)postgresql(dot)org
>
> 2009/7/7 Jaime Casanova :
>> 2009/7/2 Jaime Casanova :
>>> 2009/7/1 Jaime Casanova :
>>>
>>>> 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!!!
>>
>
> otra solucion es usar ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
>
> select tipo, numero, cantidad, sum(cantidad) over (order by fecha rows
> between unbounded preceding and current row)
> 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;
>
> aunque hasta que me acostumbre a las funciones windows y la idea de
> los frames y los partitions creo que seguire usando el truco anterior
> :D
>
> --
> Atentamente,
> Jaime Casanova
> Soporte y capacitación de PostgreSQL
> Asesoría y desarrollo de sistemas
> Guayaquil - Ecuador
> Cel. +59387171157
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live
http://clk.atdmt.com/MRT/go/119462413/direct/01/
From | Date | Subject | |
---|---|---|---|
Next Message | Edwin Quijada | 2009-07-07 19:04:28 | RE: Llamada a script externo |
Previous Message | Wolfgang Rodriguez | 2009-07-07 19:00:15 | RE: Ayuda urgente!!!!!!! |