pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gene Selkov Jr. <selkovjr@mcs.anl.gov>
To: Thomas Good <tomg@admin.nrnet.org>
Cc: PostgreSQL List <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] Re: Using the IN predicate in an UPDATE...
Date: Wed, 14 Oct 1998 16:27:07 -0400
Message-ID: <199810142125.QAA03426@antares.mcs.anl.gov> (raw)
In-Reply-To: <l03110701b24a637bb536@[194.90.105.28]>

> 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



view thread (6+ messages)  latest in thread

Message-ID: <199810142125.QAA03426@antares.mcs.anl.gov>
Permalink:  ../199810142125.QAA03426@antares.mcs.anl.gov/
Also on:    postgresql.org/message-id/199810142125.QAA03426@antares.mcs.anl.gov

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: selkovjr@mcs.anl.gov, tomg@admin.nrnet.org
  Subject: Re: [SQL] Re: Using the IN predicate in an UPDATE...
  In-Reply-To: <199810142125.QAA03426@antares.mcs.anl.gov>
  References: <l03110701b24a637bb536@[194.90.105.28]> <199810142125.QAA03426@antares.mcs.anl.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox