Re: [SQL] Using the IN predicate in an UPDATE...

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Thomas Good <tomg(at)admin(dot)nrnet(dot)org>, Leslie Mikesell <les(at)Mcs(dot)Net>
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Using the IN predicate in an UPDATE...
Date: 1998-10-18 09:24:53
Message-ID: l03110700b24f63bf94e4@[194.90.105.28]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)mcs(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michel \'ZioBudda\' Morelli 1998-10-18 20:28:51 NULL DATE
Previous Message Vladimir Litovka 1998-10-17 17:48:31 RE: [SQL] Is this BUG or FEATURE?