select * from x where y isnull;
select * from x where y notnull;
select * from x where y not null;
select * from x where y is null;
select * from x where y is not null;
However that is assuming the Y is actually NULL… and empty string for example is an empty string… .NOT a NULL value
Thanks, Guys. This one has been interesting. I’m writing all of my databases in MySQL and then have a Xojo function set that builds identical databases in SQLite. The interesting thing is the way you write a View in MySQL is changed internally. For example I wrote the part of the WHERE clause
(customers.phone.IsValid = 1 OR customers.phone.IsValid IS NULL)
When I’m reading the view from the MySQL information_schema.views the VIEW_DIFINITION field, MySQL has changed that particular line of the WHERE clause is changed to:
((`customers`.`phone`.`IsValid` = 1) or isnull(`customers`.`phone`.`IsValid`))
That actually happens with quite a few things when the view is compiled, so I have written several search and replace functions that I have to use. To get this particular issue to work in SQLite, I have to change it to:
((`customers`.`phone`.`IsValid` = 1) or ifnull(`customers`.`phone`.`IsValid`, NULL))
Notice that I changed isnull to ifnull and then added , NULL before the first closing parenthesis.
I already have a function that does much the same for something else, so it shouldn’t be too bad.