lundi 13 février 2017

Rows for which the WHERE condition evaluates to NULL?

Vote count: 0

After executing the following query in MySQLWorkbench, only the first row was returned.

select * from (
  select true as a
  union select false as a
  union select null as a
) x
where a

My takeaway from this is that rows such that the query's where clause evaluates to null will be filtered out. However, I could not find documentation of this behavior, so I wanted to check whether I can assume this behavior will always occur before writing queries that rely on it. Hence,

  1. Will this behavior always occur, and if so,

  2. Is there documentation of that?

asked 19 secs ago

Let's block ads! (Why?)



Rows for which the WHERE condition evaluates to NULL?

Aucun commentaire:

Enregistrer un commentaire