Home  >  Article  >  Database  >  What does union all mean?

What does union all mean?

王林
王林Original
2020-06-28 13:17:3270822browse

"Union all" means "union all", which refers to the union operation of two result sets, including duplicate rows, without sorting. The UNION operator is used to merge the result sets of two or more SELECT statements; the SELECT statements inside UNION need to have the same number of columns, and the columns need to have similar data types.

What does union all mean?

The operating environment of this tutorial: windows7 system, mysql8 version, Dell G3 computer.

What does union all mean?

union all operator

Union All refers to two result sets Union operations, including duplicate rows, are not sorted.

The UNION operator is used to combine the result sets of two or more SELECT statements.

Note: The SELECT statements inside UNION must have the same number of columns. Columns must also have similar data types. Also, the order of the columns in each SELECT statement must be the same.

Let’s give an example:

Create database:

What does union all mean?

Create table:

What does union all mean?

Insert test data:

What does union all mean?

Query:

What does union all mean?

(Recommended tutorial: mysql tutorial)

The above is the detailed content of What does union all mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn