Re: RE: Help with UPDATE syntax - Mailing list pgsql-sql

From Richard Huxton
Subject Re: RE: Help with UPDATE syntax
Date
Msg-id 012e01c0ad8f$335aef60$1001a8c0@archonet.com
Whole thread Raw
In response to RE: Help with UPDATE syntax  (Michael Davis <mdavis@sevainc.com>)
List pgsql-sql
From: "Michael Davis" <mdavis@sevainc.com>

> Try eliminating the statement " from user_group_map map".  It does not
belong in the update.  Here is the fully rewritten statement:
>
> update
>          user_group_map
>     set
>          user_id = 4
>     where
>          user_id = 9 and
>          not exists (
>              select * from
>                    user_group_map ug2
>              where
>                     user_id = 4 and
>                     ug2.group_id = map.group_id and                                    ^^^
>                     ug2.role = map.role);                                ^^^
I take it these are actually "user_group_map"?

- Richard Huxton



pgsql-sql by date:

Previous
From: Roberto Mello
Date:
Subject: Contribute to the PL/pgSQL CookBook !!
Next
From: jkakar@expressus.com
Date:
Subject: Re: Normalization is always good?