In SQL, the keyword for union is UNION, which is used to combine the results of multiple SELECT statements into a single result set that contains all unique rows.
Keywords representing union in SQL
In SQL, the keywords representing union are:
Using UNION
UNION
keyword is used for Combines the results of two or more SELECT statements into a single result set. The result set contains all unique rows from both input tables.
Syntax:
<code class="sql">SELECT 列名1, 列名2, ... FROM 表名1 UNION SELECT 列名1, 列名2, ... FROM 表名2;</code>
For example:
<code class="sql">SELECT name, city FROM table1 UNION SELECT name, city FROM table2;</code>
The above query will return table1
and table2
The name
and city
columns for all unique rows in the table.
The above is the detailed content of What are the keywords that represent union in sql. For more information, please follow other related articles on the PHP Chinese website!