From: | Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com> |
---|---|
To: | Gustavo Vaccaro <gustavo_vaccaro(at)fibertel(dot)com(dot)ar> |
Cc: | arpug(at)postgresql(dot)org |
Subject: | Re: Problema con UPDATE |
Date: | 2010-10-05 14:53:11 |
Message-ID: | AANLkTimLg=hbN=PiabRBAqVt9+kLBdP5Ye3pPUGZ=+Dh@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | arpug |
El día 6 de septiembre de 2010 02:40, Gustavo Vaccaro
<gustavo_vaccaro(at)fibertel(dot)com(dot)ar> escribió:
> A quien me pueda ayudar,
>
> Estoy migrando una base de datos de Sybase Anywhere 9 a PostgresSQL 8.4.
>
> Para probar como funciona PostgreSQL 8.4 le hice 2 tablas remitoing y stock
> y me puse a jugar.
>
> Cargue remitoing y stock con algunos datos para empezar con algo.
> Si hago estas consultas, obtengo lo siguiente:
>
> SELECT * FROM remitoing;
> nroremito articulo cantidad
> ------------------------------------
> 10 0001 100
> 11 0001 10
> 12 0001 30
>
> SELECT * FROM stock;
> articulo disponible
> ------------------------
> 0001 0
>
> Cuando ejecuto:
>
> UPDATE stock
> SET disponible = disponible + remitoing.cantidad
> FROM remitoing
> WHERE stock.articulo=remitoing.articulo;
>
UPDATE stock
SET disponible = (disponible + remitoing.remitoing)
FROM remitoing
WHERE stock.articulo = remitoing.articulo;
Creo que es un tema de parentesis. A mi me acumuló.
--
Emanuel Calvo Franco
Independient DBA
www.emanuelcalvofranco.com.ar
From | Date | Subject | |
---|---|---|---|
Next Message | Emanuel Calvo Franco | 2010-10-06 15:38:24 | Curso Noviembre a distancia de Administración Postgresql |
Previous Message | Mariano Reingart | 2010-09-20 19:57:06 | == PostgreSQL: Noticias semanales - 19 de Septiembre de 2010 == |