Venelin Arnaudov wrote:
> Hi
>
> I want to update the values of one column of a table based on the
> matches in a second table
> something like
> update table1
> set table1.field2_new=table2.new_id
> from table2
> where table1.field2_old=table2.old_id;
Did you try it?
http://www.postgresql.org/docs/8.2/static/sql-update.html
PG has a non-standard "FROM" extension for just this purpose.
--
Richard Huxton
Archonet Ltd