Wednesday, 28 October 2015

Difference between Union and Union ALL in SQL?

Union
Union ALL
Union only selects distinct values.
Union all select all values in the table.
Union removes duplicate rows.
Union all doesn’t removes duplicate rows.
Output is in sorted order so that it is faster.
Output is not sorted order.

No comments:

Post a Comment