Both commands combines the tables with common fields except ‘UNION’ displays all the rows from objects without looking at duplicate records whereas ‘UNION ALL’ looks for it and displays only unique records. Thus ‘UNION’ it slower than ‘UNION ALL’
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Both commands combines the tables with common fields except ‘UNION’ displays all the rows from objects without looking at duplicate records whereas ‘UNION ALL’ looks for it and displays only unique records. Thus ‘UNION’ it slower than ‘UNION ALL’
Union will remove the duplicate rows from the result set while Union All doesn’t.