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

Leslie Mikesell <les@mcs.net>

From: Leslie Mikesell <les@Mcs.Net>
To: tomg@admin.nrnet.org
Cc: herouth@oumail.openu.ac.il, pgsql-sql@postgreSQL.org
Date: 1998-10-15T03:21:09Z
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@mcs.com