Answers

Question and Answer:

  Home  Basic SQL Server

⟩ Explain what is the difference between UNION and UNION ALL?

UNION selects only distinct values whereas UNION ALL selects all values and not just distinct ones.

UNION: SELECT column_names FROM table_name1

UNION

SELECT column_names FROM table_name2

UNION All: SELECT column_names FROM table_name1

UNION ALL

SELECT column_names FROM table_name2

 163 views

More Questions for you: