In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces what is mysql joint query, the content of the article is carefully selected and edited by the author, with certain pertinence, the reference significance for everyone is still relatively large, the following with the author to understand what is mysql joint query bar.
Basic concept: Combine the results of two query statements with the same number of fields into one query result in a "stacked" manner.
See:
The "number of fields" of query results of two select statements must be consistent;
Generally, you should also make the field types of two query statements consistent;
You can also combine more query results;
Grammatical form:
select statement 1union [all]| distinct] select statement 2;
Note:
This union query statement defaults to "automatic elimination of duplicate rows," i.e. distinct by default
If you want to display all data (duplicate rows allowed), use all
Details:
The result of this union query should be understood as ultimately also a "tabular data" and defaults to the field names in the first select statement;
Comparison:
By default, order by and limit clauses can only sort and limit the results after the entire union:
select... union select... order by XXX limit m,n;
Example:
implement "total outside join": select * f rom Table 1 left join Table 2 on condition unionselect * f rom Table 1 right join Table 2 on condition
Example:
The results are:
Basic concept: Combine the results of two query statements with the same number of fields into one query result in a "stacked" manner.
See:
The "number of fields" of query results of two select statements must be consistent;
Generally, you should also make the field types of two query statements consistent;
You can also combine more query results;
Grammatical form:
select statement 1union [all]| distinct] select statement 2;
Note:
This union query statement defaults to "automatic elimination of duplicate rows," i.e. distinct by default
If you want to display all data (duplicate rows allowed), use all
Details:
The result of this union query should be understood as ultimately also a "tabular data" and defaults to the field names in the first select statement;
Comparison:
By default, order by and limit clauses can only sort and limit the results after the entire union:
select... union select... order by XXX limit m,n;
Example:
implement "total outside join": select * f rom Table 1 left join Table 2 on condition unionselect * f rom Table 1 right join Table 2 on condition
Example:
The results are:
After reading the above joint query on what is mysql, many readers must have some understanding, if you need to obtain more industry knowledge information, you can continue to pay attention to our industry information column.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.