Re: Update Current Row Based on Prior Row

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Update Current Row Based on Prior Row
Дата
Msg-id
23694.1338671831@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Update Current Row Based on Prior Row Philip Brooks <philswatch@yahoo.com>
Re: Update Current Row Based on Prior Row Andreas Kretschmer <akretschmer@spamfence.net>
Re: Update Current Row Based on Prior Row Tom Lane <tgl@sss.pgh.pa.us>
Philip Brooks  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 по дате отправления
От: Philip Brooks
Дата:
От: Andreas Kretschmer
Дата:
FAQ