On Jan 12, 2008 11:26 PM, Sergei Shelukhin <realgeek@gmail.com> wrote:
> Hmmm. What if there's more than one table? Is "from x,y" a viable option?
UPDATE table1 t1
SET blah = 1
FROM (
SELECT t2.t1id
FROM table2 t2
JOIN table3 t3
ON t2.id = t3.t2id
) foobar
WHERE t1.id = foobar.t1id
It's all in the docs:
http://www.postgresql.org/docs/8.2/static/sql-update.html
Good luck.