What is the difference between UNION and UNION ALL?

SQL Fundamentals Easy

SQL Fundamentals — Easy

What is the difference between UNION and UNION ALL?

Key points

  • UNION removes duplicates, UNION ALL keeps all rows
  • UNION combines results, UNION ALL simply appends them
  • UNION is more resource-intensive due to duplicate removal

Ready to go further?

Related questions