Back to Developer Roadmap

Union Vs Union All

src/data/question-groups/sql-queries/content/union-vs-union-all.md

4.0258 B
Original Source

UNION is used for removing duplicates while UNION ALL keeps all duplicates. UNION is slower compared to UNION ALL because of de-duplication. You use UNION when you want to obtain unique records and UNION ALL when you want every row even if they are repeated.