Usage of visual charts in MySQL and tips for joining multiple tables with INNER

Source: Internet
Author: User

Multi-table join query. If the relationship between tables is clear and the structure is simple, creating a view SQL code CREATE VIEW view_name AS SELECT t1.xxx, t2.xxx, t3.xxx FROM (table1 t1 inner join table2 t2 ON t1.fid = t2.fid) inner join table3 t3 ON t1.mid = t3.mid; three table associations are used here, tips for writing multi-table join inner join statements 1. first, write the simplest 2-table join INNER JOIN2. then use () to expand all data FROM after FROM to the end of the statement. JOIN at the end of the statement and JOIN with the inner join of the next table. Remember this principle. In the future, four tables will be associated, and five tables will not be difficult. Delete the VIEW SQL code DROP VIEW view_name author lj6684

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.