How to compare NULL values with other significant values