Quote Originally Posted by veti View Post
But, it's the rules set out in the SQL standard that define the meaning of "NULL" in SQL. And in this instance at least, they are clearly not treating it as "unknown", but more like "no value".
I suppose that's true....At the same, any aggregate function that works with values would need to return NULL if there's any NULL in the set it's working on, undercutting the general usefulness of aggregate functions without some sort of prefiltering scheme...and it turns out SQL's prefiltering scheme is "filter out NULL values before passing to aggregate functions that aren't COUNT(*) ." Which, incidentally, means you could compare a COUNT with a COUNT(*) to check for the presence (and number) of NULLs, when that's important.

Is it kind of a hacky way to say "MAX returns the highest known value" and not need special steps for when a value might be (or might ever become) NULL? Yes...but I think I'm okay with erring on the side of maintainability, in this case.