In the practical application, often need to implement in a query statement to display more than one table of data, this is called a multiple table data record connection query, referred to the next year will be the query.
When you implement a
One: Connection query:Connection query is to connect two or more tables according to a certain condition, select the required data, the connection query query two or more tables at the same time, when there are fields representing the same meaning
A multiple-table query using the SELECT clauseSELECT field name from Table 1, table 2 ... WHERE table 1. field = Table 2. Fields and other query conditionsSELECT A.id,a.name,a.address,a.date,b.math,b.english,b.chinese from Tb_demo065_tel as
MySQL Query performance optimizationThe optimization of MySQL query performance involves many aspects, including library table structure, establishing reasonable index and reasonable query. The library table structure includes how to design
High Performance MySQL Reading Notes-query performance optimization, high performance mysql
For high-performance database operations, it is not enough to design the optimal database table structure and build the best index. You also need to design
LOCK TABLES
tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}
[, tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}] ...
UNLOCK TABLES
Lock tables can lock the table used for the current thread. If the table is locked by other
For high-performance database operation, it is not enough to design the optimal library table structure, and to establish the best index, but also need reasonable design query. If the query is poorly written, high performance cannot be achieved even
The PHP statement is used to query multiple tables in MYSQL and displayed on the page. the fields of multiple tables are the same and the table names are different. For example: & nbsp; abc201202, abc201203, abc201204... the table name is created on
This article introduces four database query methods by combining text and text: Basic query, connection query, subquery, and regular expression query, for more information, see query data to obtain the required data from the database. Data query is
Abstract: This article describes how to optimize SQL queries. You can manually use the EXPLAIN statement to check the efficiency of SQL queries. In addition, some principles for optimizing SQL statements are described, mainly about how to optimize
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.