AntiPattern
SQL Misaggregation and Filters
sql-misaggregation-filtering
SQL logic breaks when aggregation/grouping semantics or subquery scoping are misunderstood—ROLLUP/UNION/distinct, NOT IN/EXISTS, and UPDATE-with-LIMIT patterns—leading to missing subtotals, unintended duplicates, or silently incomplete row sets across DBMS.