Which Pumps Appear on Either List but Are Still Unfinished?

Combine, compare and subtract query results while keeping duplicate policy, column meaning and final ordering explicit.

14 sections · 4 questions · 1 coding challenge

1 / 14

Combining Results Needed a Duplicate Policy

BOTIE

SQL result combinations draw on set operations, but ordinary query results may contain repeated rows. SQL therefore distinguishes UNION, which removes duplicate result rows, from UNION ALL, which retains them. INTERSECT and EXCEPT describe common rows and rows left after subtraction.

That choice matters at the maintenance desk. Repeated alerts can be useful events in one report and unwanted repeated pump assignments in another. We need to choose the result’s meaning before deciding whether two equal rows should collapse.

Sources for this history