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

From: "Gene Selkov Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
To: Thomas Good <tomg(at)admin(dot)nrnet(dot)org>
Cc: PostgreSQL List <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] Re: Using the IN predicate in an UPDATE...
Date: 1998-10-14 20:27:07
Message-ID: 199810142125.QAA03426@antares.mcs.anl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-sql by date

  From Date Subject
Next Message Leslie Mikesell 1998-10-15 03:21:09 Re: [SQL] Using the IN predicate in an UPDATE...
Previous Message Herouth Maoz 1998-10-14 14:42:32 Re: Using the IN predicate in an UPDATE...