Обсуждение: CASE WHEN

Поиск
Список
Период
Сортировка

CASE WHEN

От
Luiz Eduardo Cantanhede Neri
Дата:
Hi guys,

Just a simple question.

It's known that in SQL field = NULL is diferrent from from field IS NULL. Does the same rule applies when you use CASE .. WHEN statement ?

e.g.
CASE myField
WHEN IS NULL THEN....


From my tests, shows this sintaxt is incorrect so I replaced to
CASE myField
WHEN NULL THEN ...

this 2nd example worked so far, but I'm worried about that isn't correct way of doing it and may generate some failure returning rows with inconsistent data.
So, you guys know if using this way is a valid CASE/WHEN sentence?

I know also there's
CASE
WHEN myField IS NULL THEN ...

but I'm asking about the 2nd way to make it clear to me.

Thx