What does UNION ALL do differently from UNION?

SQL Data Analyst Easy

SQL Data Analyst — Easy

What does UNION ALL do differently from UNION?

Key points

  • UNION ALL includes duplicates, while UNION removes them
  • UNION ALL combines all rows from both queries
  • UNION ALL is useful when duplicates are needed in the result set

Ready to go further?

Related questions