Re: SQL - update table problem...

From: Matthias(dot)Pitzl(at)izb(dot)de
To: riki_fox(at)hotmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: SQL - update table problem...
Date: 2006-11-13 13:24:45
Message-ID: 11EC9A592C31034C88965C87AF18C2A70CFCE2@m0000s61
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

According to the synopsis of UPDATE you just can update one table at a time.
Just use more UPDATE commands inside a transaction.

-- Matthias

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org
> [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Marko Rihtar
> Sent: Monday, November 13, 2006 2:21 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: [GENERAL] SQL - update table problem...
>
>
> Hi,
>
> i'm trying to make update on multiple tables but don't know how.
> is something like this posible with postgresql?
>
> update table1
> join table2 on (table1.id=table2.t1)
> join table3 on (table2.id=table3.t2)
> set table1.name='test', table2.sum=table1.x+table2.y,
> table3.cell='123456789'
> where table1.id=6
>
> i know that this syntax is not supported with postgres but i tried to
> rewrite the code using this synopsis:
>
> UPDATE [ ONLY ] table SET column = { expression | DEFAULT } [, ...]
> [ FROM fromlist ]
> [ WHERE condition ]
>
> i failed again.
> updating multiple tables, can it be done?
>
> thanks for help
>
> _________________________________________________________________
> FREE pop-up blocking with the new MSN Toolbar - get it now!
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
http://archives.postgresql.org/

Browse pgsql-general by date

  From Date Subject
Next Message Marko Rihtar 2006-11-13 13:28:10 system tables...
Previous Message Marko Rihtar 2006-11-13 13:20:55 SQL - update table problem...