Tuesday, January 3, 2012

Checking nulls with MySQL

Assuming QuantityPerUnit is the field to be tested.
1:  -- return products with no null values  
2:  select * from products where QuantityPerUnit is not null;  
3:  -- return products with null values  
4:  select * from products where isnull(QuantityPerUnit);  

0 comments:

Post a Comment