I had what I thought was a simple update query.. and it has stumped me.
I have a table ordered by a SERIAL named ROWID.
In that table I have a column named TITLE.
Where TITLE is null, I want to set it equal to the previous row's TITLE.
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.
Ideas?