68
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:
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:
Next TopicMariaDB Intersect Operator