Home » MariaDB Union All Operator

MariaDB Union All Operator

by Online Tutorials Library

MariaDB UNION ALL Operator

MariaDB UNION ALL Operator is same as UNION operator but it doesn’t remove the duplicate records. It returns all rows from the query and it does not remove duplicate rows between the various SELECT statements.

Syntax:

Note: In MariaDB UNION ALL operator, each SELECT statement must have the same number of fields in the result sets with similar data types.


Return Single Field using UNION ALL Operator

Output:

MariaDB Union all operator 1

You can see that it does not remove duplicate records.


UNION ALL Operator with ORDER BY Clause

Use UNION ALL operator with ORDER BY clause to retrieve multiple columns from both table.

Output:

MariaDB Union all operator 2

You may also like