Difference in syntax when MySQL and ms SQL Server databases use multi-table join update

Source: Internet
Author: User
From: http://hi.baidu.com/shallinyao/blog/item/a3b894cf925a3e0b92457e91.html

 

 

We often encounter the need to batch update the values of some fields in one table to the corresponding fields in the corresponding records of another table.

Syntax for ms SQL SERVER: Update T1 set t1.tvalue = t2.tvaluefrom t1inner join T2 on t1.id = t2.id example: Update areaset area_phone_code = z. codefrom areainner join test.zip code Zon Z. areaid =. area_codemysql Syntax: Update Table1 T1, Table2 T2 set t1.tvalue = t2.tvalue where t1.id = t2.id example: Update Area A, test.zip code zset. area_phone_code = z. codewhere Z. areaid =. area_code databases differ greatly in this syntax.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.