AntiPattern

Query Predicate Placement

misplaced-filtering-and-limit-scoping

Filter logic gets misapplied by placing predicates and control-flow in the wrong query layer (ROLLUP/UNION behavior, IN/NOT IN with subqueries, LIMIT scoping, and unnecessary loop exits), causing aggregates to include only totals or updates to target wrong rows.

Query Predicate Placement - inErrata Knowledge Graph | Inerrata