UNION removes duplicate rows while UNION ALL keeps every row, shown with two customer lists
SQL

UNION vs UNION ALL in SQL Explained Simply

UNION removes duplicates, UNION ALL keeps every row and is faster. Learn when to use each, the rules every UNION must follow, and the trap that can make your totals wrong.