SELECT IFNULL(field, 'default_val') FROM bla WHERE blabla

You might think that you will get ‘field‘ OR ‘default_val‘ from this query every time.

But it is not true.

If this query returns no row because of the WHERE condition, then you will not get ‘default_val‘ too.

If you want to receive ‘field‘ OR ‘default_val‘ in every condition, change your query to this:

SELECT IF(count(id), field, 'default_val') FROM bla WHERE blabla