UNION ALL

SQL UNION ALL Keyword

The UNION ALL command combines the result sets of two or more SELECT statements into a single result set. Unlike UNION, it does not remove duplicate values — all matching rows from both queries are included.

Tutorials dojo strip

SQL UNION ALL Syntax

SQL

SQL UNION ALL Example

This query combines all gender values from Patients and all specialty values from Doctors, including any duplicates.

SQL

SQL UNION ALL Labs

Tutorials dojo strip