Re: [SQL] Using the IN predicate in an UPDATE... - Mailing list pgsql-sql

From Leslie Mikesell
Subject Re: [SQL] Using the IN predicate in an UPDATE...
Date
Msg-id 199810150321.WAA24646@Jupiter.mcs.net
Whole thread Raw
In response to Using the IN predicate in an UPDATE...  (Thomas Good <tomg@admin.nrnet.org>)
Responses Re: [SQL] Using the IN predicate in an UPDATE...  (Thomas Good <tomg@admin.nrnet.org>)
List 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

pgsql-sql by date:

Previous
From: "Gene Selkov Jr."
Date:
Subject: Re: [SQL] Re: Using the IN predicate in an UPDATE...
Next
From: shields@crosslink.net (Michael Shields)
Date:
Subject: Re: [SQL] dilemma