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

From: Leslie Mikesell <les(at)Mcs(dot)Net>
To: tomg(at)admin(dot)nrnet(dot)org
Cc: herouth(at)oumail(dot)openu(dot)ac(dot)il, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Using the IN predicate in an UPDATE...
Date: 1998-10-15 03:21:09
Message-ID: 199810150321.WAA24646@Jupiter.mcs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

According to Thomas Good:
> This query takes 20 years (poetic licence invoked ;-).
> Do you have a smarter way to accomplish this end:
>
> UPDATE table1 SET id = 2
> WHERE rec_num IN
> ( SELECT rec_num
> FROM table1
> WHERE id = 1
> );

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Shields 1998-10-15 07:35:35 Re: [SQL] dilemma
Previous Message Gene Selkov Jr. 1998-10-14 20:27:07 Re: [SQL] Re: Using the IN predicate in an UPDATE...