MySQL use inner join for query/delete/Modify Example

Source: Internet
Author: User
Tags join
This article describes the use of inner join to query/delete/modify, the specific implementation of the following, learning MySQL friends can also learn, I hope to help you copy the code is as follows:
--Query
SELECT tp.tp_id, TP.TPMC, Tp.leveid, Tp.tpdz, TP.JGM, TP.SCSJ, Tp.pbzyid, TP.KSBFSJ, TP.JSBFSJ, Tp.status, TP.TPBZ from QD Gl_tupian TP INNER JOIN QDGL_PQB PQ
On Tp.tp_id=pq.tpid WHERE pq.bfjgm= ' 27010825 ' and PS_BFSJ >= ' 2013-01 ' and ps_bfsj< 2013-05-31;

Copy Code code as follows:
--Modify
UPDATE jx_lsjl jx INNER JOIN isa_gtxx gt on JX.CKID=GT.GTBH set Jx.ckid=gt.gtid WHERE gt.jgm= ' 27010825 ' and jx.jgm= ' 270108 25 ';

Copy Code code as follows:


--Delete
DELETE from JX_LSJL jx INNER JOIN isa_gtxx gt on jx.ckid=gt.gtbh WHERE gt.jgm= ' 27010825 ' and jx.jgm= ' 27010825 ';

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.