Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0I4EFV98263 for ; Thu, 17 Jan 2002 23:14:15 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g0I4EJ303912; Thu, 17 Jan 2002 23:14:19 -0500 (EST) To: "Josh Berkus" cc: pgsql-sql@postgresql.org Subject: Re: UPDATE Query problem In-reply-to: References: Comments: In-reply-to "Josh Berkus" message dated "Thu, 17 Jan 2002 19:59:27 -0800" Date: Thu, 17 Jan 2002 23:14:18 -0500 Message-ID: <3909.1011327258@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/214 X-Sequence-Number: 6298 "Josh Berkus" writes: > Interesting. however, it appears to give me the most recent record with > non-NULL values. What I want is the most recent record with non-NULL values > *before* the record I'm trying to update. Oh, I'm sorry: forgot the extra qualification on the innermost SELECT: AND oldest.timestamp < history.timestamp > Yeah, you guessed it ... MS SQL Server 7. I dunno, how good is SQL Server on subselects? regards, tom lane