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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -