Go to Top

Tag Archives

Tag Archives: SQL

SQL Tech Tip: UNION ALL vs. UNION?

When doing a union query, is it better to use UNION ALL versus UNION? The UNION will try and eliminate duplicate rows between the two queries and essentially does a select distinct on the entire query. Most of the time when doing a union, users build the queries so that each query returns unique results and therefore they don’t need UNION. So, if you have a slow union query, try …Read More