UNION combines the results of two or more SELECT queries and automatically removes duplicate rows from the final result set. UNION ALL also combines results, but keeps all rows, including duplicates. UNION requires additional resources to check for uniqueness, so it works slower than UNION ALL. Use UNION if it is important to exclude duplicates, and UNION ALL if you need all records.
Comments 0
No comments yet
Sign in or register to leave a comment.
Sign In·Sign up