Thursday, July 29, 2010

SQL Update with select

Here is example of the update query syntax which will update mutiple columns of the table with values from select statment.

UPDATE tgt
SET ( tgt.x, tgt.y ) = ( SELECT src.x, src.y FROM src WHERE src.id = tgt.id )

No comments: