Received: from antares.mcs.anl.gov (mcs.anl.gov [140.221.9.6]) by hub.org (8.8.8/8.8.8) with SMTP id RAA08424 for ; Wed, 14 Oct 1998 17:27:05 -0400 (EDT) (envelope-from selkovjr@mcs.anl.gov) Received: from mcs.anl.gov (selkovjr@slip50.slip.anl.gov [146.137.252.99]) by antares.mcs.anl.gov (8.6.10/8.6.10) with ESMTP id QAA03426; Wed, 14 Oct 1998 16:25:34 -0500 Message-Id: <199810142125.QAA03426@antares.mcs.anl.gov> To: Thomas Good Cc: PostgreSQL List Subject: Re: [SQL] Re: Using the IN predicate in an UPDATE... In-Reply-To: Your message of "Wed, 14 Oct 1998 16:42:32 +0200." Date: Wed, 14 Oct 1998 16:27:07 -0400 From: "Gene Selkov Jr." > 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