News for hackers. Stuff that matters.
Re:SELECT wat FROM sql by da_chicken on Monday April 27, 2020 @05:57PM (#23000592)
> Then why on earth is NULL being treated the same as false for the purposes of a WHERE clause.

Because, by definition, the WHERE clause returns a record when it evaluates to TRUE. FALSE and UNKNOWN are not TRUE.

Second, you absolutely can do what you're trying to here, but not the way you've done it:

  SELECT CASE WHEN bar = baz THEN 'foo' ELSE 'bar' END AS corge
  FROM quux
You're asking the wrong question and wondering why you're getting the wrong answer.

There are no comments on this comment yet.