Databases · Junior · Question 31 of 75

What is the difference between UNION and UNION ALL?

Explanation

Both stack the results of two queries with matching columns. Use UNION ALL when duplicates are impossible or wanted: it's faster.

Further reading

Problem with a question

Databases · Junior · question 31

Test yourself

Take the Databases · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz