BP012

CASE without ELSE

The CASE statement doesn't specify what happens when all WHEN expressions evaluate to FALSE.

The ELSE clause can be omitted but unless you use the ELSE clause of the CASE statement, you will find that a NULL is returned if all WHEN expressions return FALSE. If you really want to do this, make it explicit so the code is easier to understand.



Didn't find what you were looking for?