Re: Update Current Row Based on Prior Row - Mailing list pgsql-novice

From Tom Lane
Subject Re: Update Current Row Based on Prior Row
Date
Msg-id 23694.1338671831@sss.pgh.pa.us
Whole thread Raw
In response to Update Current Row Based on Prior Row  (Philip Brooks <philswatch@yahoo.com>)
List pgsql-novice
Philip Brooks <philswatch@yahoo.com> writes:
> In SQLite, I did it with this:
> UPDATE bf
> SET title = (
> � SELECT title
> � FROM bf AS prev
> � WHERE title IS NOT NULL AND prev.rowid < bf.rowid
> � ORDER BY prev.rowid DESC
> � LIMIT 1
> )
> WHERE title IS NULL

> The update is not porting to Postgresql.

Really?  Seems to work for me.

            regards, tom lane

pgsql-novice by date:

Previous
From: Philip Brooks
Date:
Subject: Update Current Row Based on Prior Row
Next
From: Andreas Kretschmer
Date:
Subject: Re: Update Current Row Based on Prior Row