MERGE matches source rows to target rows by key. Two source rows for one target key is an undefined match: the standard does not say which update wins, so engines differ.
MERGE INTO stock USING deltas ON stock.sku = deltas.sku WHEN MATCHED THEN UPDATE SET qty = stock.qty + deltas.delta; SELECT sku, qty FROM stock ORDER BY sku;
MERGE INTO stock USING ( SELECT sku, SUM(delta) AS delta FROM deltas GROUP BY sku ) d ON stock.sku = d.sku WHEN MATCHED THEN UPDATE SET qty = stock.qty + d.delta; SELECT sku, qty FROM stock ORDER BY sku;
Verification found the silent case is real — the engine applied one of two updates and reported success; loud failure (Postgres) is the good outcome.
Pre-aggregate the source, or dedupe it to one row per target key before the MERGE.
USING (SELECT key, SUM(val) AS val FROM src GROUP BY key) s