SQL Query Optimization

UNION vs UNION ALL use in SQL Queries

A UNION operation combines two sets of columns and removes duplicates. The UNION ALL expression does the same but does not remove the duplicates. When DB2 encounters the keyword, it processes each select / sub-select to form an interim result table, then it combines the interim result table and deletes duplicate rows to form a […]

UNION vs UNION ALL use in SQL Queries Read More »