Re: Update condicionados por otras tablas

From: Miguel Rodríguez Penabad <penabad(at)gmail(dot)com>
To: Yosip Abraham Curiel Jiménez <snake77se(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Update condicionados por otras tablas
Date: 2007-09-19 16:07:39
Message-ID: 95335e4e0709190907r7649e3f6r2940abd67b294608@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

El 19/09/07, Yosip Abraham Curiel Jiménez <snake77se(at)gmail(dot)com> escribió:
> asi fue que lo probe:
>
> update t_temp_edificaciones set
> edo = (select edo from ts_edificaciones_puerto_ordaz where id =
> t_temp_edificaciones.id and idut = t_temp_edificaciones.idut),
> mun = (select mun from ts_edificaciones_puerto_ordaz where id =
> t_temp_edificaciones.id and idut = t_temp_edificaciones.idut),
> par = (select par from ts_edificaciones_puerto_ordaz where id =
> t_temp_edificaciones.id and idut = t_temp_edificaciones.idut),
> sec = (select sec from ts_edificaciones_puerto_ordaz where id =
> t_temp_edificaciones.id and idut = t_temp_edificaciones.idut),
> manz = (select manz from ts_edificaciones_puerto_ordaz where id =
> t_temp_edificaciones.id and idut = t_temp_edificaciones.idut),
> parcela = (select parcela from ts_edificaciones_puerto_ordaz where id =
> t_temp_edificaciones.id and idut = t_temp_edificaciones.idut);

Si me pasas la estructura de las tablas quizás pueda aportar algo más
(por privado si quieres, y luego comentamos aquí la solución), pero si hay
una subconsulta que devuelve más de una fila quiere decir que la tabla
ts_edificaciones_puerto_ordaz tiene como clave primaria algo más que
id e idut.

--
Miguel Rodríguez Penabad

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Yosip Abraham Curiel Jiménez 2007-09-19 16:12:27 Re: Update condicionados por otras tablas
Previous Message Yosip Abraham Curiel Jiménez 2007-09-19 16:03:50 Re: Update condicionados por otras tablas