First is correct way of checking whether a field value is null
while later won't work the way you expect it to because null
is special value which does not equal anything, so you can't use equality comparison using =
for it.
So when you need to check if a field value is null
or not, use:
where x is null
instead of:
where x = null