Use updateinnerjoin and deleteinnerjoin in SQL

Source: Internet
Author: User
In SQL, we must all know the method of updateinnerjoin and deletnernerjoinupdateupdatexxxsetxxxwhere. Only then can we find that update and delete support the update method of innerjoin, which is useful for updating and deleting table associations. column: SQL code updatetb_Usertb_Userusrinne

In SQL, you must know the method of using update inner join and delete inner join Update XXX set XXX where. Only then can you find that Update and delete support the update method of inner join, this is very useful for updating and deleting table associations. column: SQL code update tb_User usr inne

Use update inner join and delete inner join in SQL

UpdateUpdate XXX set XXX where is well known, only to find that update and delete support the update method of inner join, which is very useful for updating and deleting tables. column: SQL code update tb_User usrinner join tb_Address addr on usr. nAddressFK = addr. the format of nAddressIDtb_User tb_User usr update is update t1 set t1.name = 'liu' from t1 inner join t2 on t1.id = t2.tidMYSQL. ACCESS is written as follows: SQL code UPDATE mem_world AS mw1 INNER JOIN mem_world AS mw2ON mw1.parentid = mw2.widmw2. B Aseid mw2.parentid mw2.size> 1; mw2.mw2. parentid mw2.size> 1; on is the filtering condition for table join, that is, after the table is connected, this will generate something similar to a temporary view where filters data from this temporary view. Therefore, you must first find out the virtual host and server space, which of the following statements does your so-called two conditions belong to? The Deletedelete statement is similar to t2 on t1.id = t2.tid. Pay attention to the blue part. Mysql: SQL code DELETE mwb FROM mem_world_building AS mwb INNER JOIN mem_world AS mwON mwb. wid = mw. widbaseid mw. parentid mw. size> 1; baseid mw. parentid mw. size> 1; The following is ORACLE: SQL code DELETE TABLE1 where KHID exists (select KHID from table2 where FWDWID = 8) SQL code table2

Posted on

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.