SQL Two Table association query & bulk Modify field values

Source: Internet
Author: User

SQL Associated Query & Modify fields, the correct example is as follows:

--Batch Change report unit name & Update time--TT and TP Two Table association query, update the principal field in the Eligible TT table to the Ruperson field of the TP table merge into Nhis34.t_publicplaces Tpusing standard.t_organization Tton (Tt.orgcode = Tp.r_orgcode and Tp.create_time > ' 2015-05-07 00:00:00 ') when Matche D then update set Tp.ruperson = Tt.principal, Tp.update_time = ' 2015-05-07 09:12:08 ';


The error example is as follows:

--The following is the error statement/*update nhis34.t_publicplaces Set Ruperson = (select Tt.principal from nhis34.t_publicplaces TP Left JOIN Standard.t_organization tt on tt.orgcode = tp.r_orgcode where Tp.create_time > ' 2015-05-07 00:00:00 '); * *

The above error example will report the following error:

650) this.width=650; "title=" 0000000000000.png "src=" http://s3.51cto.com/wyfs02/M02/6C/88/ Wkiom1vljzcddel3aab54qyq2n8981.jpg "alt=" Wkiom1vljzcddel3aab54qyq2n8981.jpg "/>

This article is from the "Pig Flying" blog, please be sure to keep this source http://jiyanle.blog.51cto.com/6932197/1643928

SQL Two Table association query & bulk Modify field values

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.