KITFORMA · EDITORIAL ANSWER
Why does filtering a LEFT JOIN remove rows with no match?
KitForma editorial guide. A condition on the right-hand table in WHERE is evaluated after the outer join. NULL-extended unmatched rows can fail that condition.
Step-by-step answer
LEFT JOIN payments p ON p.order_id=o.id AND p.status='paid'. Keep a WHERE filter only when removing unmatched orders is intentional. Test orders with no payment, unpaid payment and multiple paid payments. Moving a predicate changes semantics; it is not merely a performance trick. Also check whether multiple matching child rows multiply the parent result.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This editorial answer was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.