From: | Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> |
---|---|
To: | Giorgio PostgreSQL <giorgio(dot)pgsql(at)gmail(dot)com> |
Cc: | PostgreSQL <pgsql-es-ayuda(at)postgresql(dot)org> |
Subject: | Re: Actualizar datos entre rango de fechas.. |
Date: | 2009-07-10 19:43:34 |
Message-ID: | 3073cc9b0907101243p4f644b61l9bde1fd2fbc05620@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
2009/7/10 Giorgio PostgreSQL <giorgio(dot)pgsql(at)gmail(dot)com>:
> Hola, como puede actualizar o que vaya incrementando el numero de dias
> (tengo un campo rumerodias tipo integer) entre el rango de dos fechas,
> ejemplo:
>
> fechastar='01/07/2009' fechaend='11/07/2009'
>
> apartir de la fechastar, el campo numerodias = 1 y asi.. hasta llegar a la
> fecha estar
update prueba set numerodias = ((select max(fecha) from prueba
where fecha between '2009-07-01' and
current_date) - fecha) - 1
where fecha between '2009-07-01' and current_date
--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157
From | Date | Subject | |
---|---|---|---|
Next Message | Giorgio PostgreSQL | 2009-07-10 20:25:08 | Re: Actualizar datos entre rango de fechas.. |
Previous Message | Raul Andres Duque | 2009-07-10 19:41:17 | Re: Caida Abrupta |