sql server - Update values in table from another table in sql unable to understand what missing -
i came across situation want update table want values come table. have written fowllowing sql , sure foolish question , last patterm complete module , need asap
update t set t.col1 = o.col1, t.col2 = o.col2 other_table o o.sql = 'cool'
you missin join
update t set t.col1 = o.col1, t.col2 = o.col2 other_table o join t on t.id = o.id o.sql = 'cool'
Comments
Post a Comment