1.

What is the difference between UNION and UNION ALL?

Answer»

UNION blends the contents of two structurally-compatible TABLES into a solitary joined table. The distinction among UNION and UNION ALL is that UNION will discard duplicate records through UNION ALL will incorporate duplicate records. Note that the presentation of UNION ALL will commonly be superior to UNION  since UNION requires the server to do the extra WORK of expelling any duplicate. In this way, in SITUATIONS where there is a SURETY that there won't be any copies, or where having copies isn't an issue, utilization of UNION ALL eventual suggested for performance reasons. Let's have a look at the below examples explaining the USAGE of both. In the first, we have used UNION and in the second we have explained UNION ALL.



Discussion

No Comment Found