Redundant ELSE NULL clause

Last modified: 03 December 2024

Reports redundant ELSE NULL clauses.

Example (MySQL):

SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;

The ELSE NULL part will never be executed and may be omitted.