UPDATE table SET col1 = a.col1, col2=a.col2 FROM anotherTable a WHERE a.anotherTableID = 1
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
SQL Update with Values from Second Table (See related posts)
Comments on this post
You need to create an account or log in to post comments to this site.
Related Posts
» count duplicate users and st... in sql count duplicates update
» Update From sample in sql update from
» Scripting schema updates in ... in sql tsql database mssql schema update tables microsoft columns query scripting information_schema alter altering
» A query from ActiveRecord th... in sql activerecord
» UDF to Add items to a comma ... in sql udf
» UDF to add items to a list, ... in sql udf
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails