Expand description
LINT_ST_002: Unnecessary CASE statement.
SQLFluff ST02 parity: detect CASE expressions that can be replaced by
simpler forms such as COALESCE(...), NOT COALESCE(...), or a plain
column reference.
Detectable patterns:
CASE WHEN cond THEN TRUE ELSE FALSE END→COALESCE(cond, FALSE)CASE WHEN cond THEN FALSE ELSE TRUE END→NOT COALESCE(cond, FALSE)CASE WHEN x IS NULL THEN y ELSE x END→COALESCE(x, y)CASE WHEN x IS NOT NULL THEN x ELSE y END→COALESCE(x, y)CASE WHEN x IS NULL THEN NULL ELSE x END→xCASE WHEN x IS NOT NULL THEN x ELSE NULL END→xCASE WHEN x IS NOT NULL THEN x END→x