pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Thomas Good <tomg@admin.nrnet.org>
To: Leslie Mikesell <les@Mcs.Net>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Using the IN predicate in an UPDATE...
Date: Sun, 18 Oct 1998 11:24:53 +0200
Message-ID: <l03110700b24f63bf94e4@[194.90.105.28]> (raw)
In-Reply-To: <Pine.LNX.3.96.981015083730.1204A-100000@admin.nrnet.org>
References: <199810150321.WAA24646@Jupiter.mcs.net>

At 14:37 +0200 on 15/10/98, Thomas Good wrote:


> > Am I missing something here or is this the same as:
> > UPDATE table1 SET id = 2 WHERE id = 1;
> > ??
> >  Les Mikesell
> >    les@mcs.com
>
> 3) Les,  What are ya, some kinda smarta**?  Yeah, somebody was missing
> something, but it weren't you...  ;-)

Hmmm. Are you sure? The original query you presented had different
semantics. It meant "If the recnum has any occurence with id=1, change all
its occurences (even those with id=17) to id=2".

That was the reason why I suggested an "exists" query instead. The above is
only equivalent when each recnum has only one id.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





view thread (6+ messages)

Message-ID: <l03110700b24f63bf94e4@[194.90.105.28]>
Permalink:  ../l03110700b24f63bf94e4@%5B194.90.105.28%5D/
Also on:    postgresql.org/message-id/l03110700b24f63bf94e4@[194.90.105.28]

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: herouth@oumail.openu.ac.il, tomg@admin.nrnet.org, les@Mcs.Net
  Subject: Re: [SQL] Using the IN predicate in an UPDATE...
  In-Reply-To: <l03110700b24f63bf94e4@[194.90.105.28]>
  References: <199810150321.WAA24646@Jupiter.mcs.net> <l03110700b24f63bf94e4@[194.90.105.28]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox