"Josh Berkus" <josh@agliodbs.com> 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