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

From Gene Selkov Jr.
Subject Re: [SQL] Re: Using the IN predicate in an UPDATE...
Date
Msg-id 199810142125.QAA03426@antares.mcs.anl.gov
Whole thread Raw
In response to Re: Using the IN predicate in an UPDATE...  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-sql
> 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
>   );

I think the urge to do everything you might need inside the server can be disabling. I would export the table to a
file,fix it (with perl, sed, whatever) and import it back again. 

--Gene

pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: Using the IN predicate in an UPDATE...
Next
From: Leslie Mikesell
Date:
Subject: Re: [SQL] Using the IN predicate in an UPDATE...