In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.