0
What is the use of union ?
3 Réponses
+ 2
where we want to join two query at one SQL statement.this is two types.
UNION and UNION ALL
0
when we use union in two sets then it gives distinct records. union all gives all the records in the set
0
The SQL UNION operator combines the result of two or more SELECT statements.
It removes duplicate rows between the various SELECT statements.
Syntax
SELECT column_name(s) FROM table1
UNION
SELECT column_name(s) FROM table2;
Example
SELECT City FROM Customers
UNION
SELECT City FROM Suppliers