News for hackers. Stuff that matters.
Re:A Critique of SQL, 40 Years Later by ianmcgowan on Wednesday August 24, 2022 @03:03PM (#32584188)
I'd check to see if y.a IS NULL in that situation. I'm sure there are cases where it matters, but most of the time for me the difference between "there's a row in y, but the value is NULL" and "there's no row in y, the value is NULL" is irrelevant. I can't think of a time when that distinction has been important, and I'm working on a project converting thousands of complex SQL queries.

The thing that really bugs me about NULL is the default assumptions - 99.9% of the time I want NULL in a string context to be the empty string and NULL in a numeric context to be 0, but I have to use ISNULL or COALESCE to get that. I wish it were the other way round where NULL is treated as '' or 0 by default, but I can do something special if I really want to test for NULL'ness.

Re:A Critique of SQL, 40 Years Later by crazygringo on Wednesday August 24, 2022 @03:22PM (#32584457)
Interesting, we must work with really different data/queries.

I've come up against the distinction lots of times (and yes have to retrieve additional fields in order to address it), while I don't ever want to confuse 0 with NULL. Tons of things are legitimately zero but crucially non-null, like an inventory count. (Empty strings, on the other hand, do seem much more interchangeable with NULL in probably the vast majority of contexts.)

Re:A Critique of SQL, 40 Years Later by emmelaich on Wednesday August 24, 2022 @11:19PM (#32589066)
'' is NULL in Oracle. People complain about it, and it always seemed a little weird to me.