Received: from Kitten.mcs.com (Kitten.mcs.com [192.160.127.90]) by hub.org (8.8.8/8.8.8) with ESMTP id XAA06509 for ; Wed, 14 Oct 1998 23:21:12 -0400 (EDT) (envelope-from les@Jupiter.mcs.net) Received: from Jupiter.mcs.net (les@Jupiter.mcs.net [192.160.127.88]) by Kitten.mcs.com (8.8.7/8.8.2) with ESMTP id WAA05820; Wed, 14 Oct 1998 22:21:10 -0500 (CDT) Received: (from les@localhost) by Jupiter.mcs.net (8.8.7/8.8.2) id WAA24646; Wed, 14 Oct 1998 22:21:09 -0500 (CDT) From: Leslie Mikesell Message-Id: <199810150321.WAA24646@Jupiter.mcs.net> Subject: Re: [SQL] Using the IN predicate in an UPDATE... To: tomg@admin.nrnet.org Date: Wed, 14 Oct 1998 22:21:09 -0500 (CDT) Cc: herouth@oumail.openu.ac.il, pgsql-sql@postgreSQL.org In-Reply-To: from "Thomas Good" at Oct 14, 98 09:06:01 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text 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