Usage of visual charts in MySQL and tips for multi-table INNERJOIN _ MySQL
Source: Internet
Author: User
The use of visual charts in MySQL and the multi-table INNERJOIN technique bitsCN.com for multi-table join queries. 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 to the inner join of the next table at the end of the statement. remember this principle. in the future, four tables will be joined. five tables will not be difficult to JOIN. deleting the VIEW SQL code DROP VIEW view_name author lj6684bitsCN.com
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