Wednesday, 24 October 2007

Update multiple rows from a query

use the following SQL as an example:

UPDATE the_table
SET a_column=a.other_column
FROM (
select other_id,other_column from other_table
)as a

WHERE
the_table.id = a.other_id