Update between two SQL tables: update the fields of the other table with the fields of one table

Source: Internet
Author: User
SQLmdash; mdash; update between two tables: update the fields of the other table with the fields of one table

SQLmdash; mdash; update between two tables: update the fields of the other table with the fields of one table

-- 1. This statement is equivalent to a Left join statement. The where clause is the number of updates.

-- Note! If the number of rows in the table (obtained after where) is smaller than that in the outer table (obtained after where), a record that does not meet the = condition will be assigned a null value.

-- If NULL values are not incorrectly assigned, AN in (select...) must be added to the External table to force the records of the internal and external tables to be consistent.

-- 2. This method is easy and error-prone.

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.