3 ms·
> I rarely use nulls like that. Well, what can I say? Other people need them, and I illustrated why. > And even then I still prefer null == null to be true.
by civilized 5y ago
> I rarely use nulls like that.
Well, what can I say? Other people need them, and I illustrated why.
> And even then I still prefer null == null to be true.
Some databases have alternate operators, like <=>, that make null == null true. And you can always coalesce null to a sentinel value if your dialect doesn't have this operator. Heck, if you're writing SQL using templates, you could have the template language replace a <=> b with coalesce(a, 99999999) = coalesce(b, 99999999) (or whatever other sentinel value you want to use).