Skip to content

Simplify CASE #2

@ranma42

Description

@ranma42

The expressions are equivalent (the arrow describes the preferred direction):

CASE
  WHEN t1 THEN r1
  ELSE CASE
    WHEN t2 THEN r2
    ELSE r3
  END
END

CASE
  WHEN t1 THEN r1
  WHEN t2 THEN r2
  ELSE r3
END

To keep the following expressions simpler, they are given using ternary notation, i.e. t1 ? r1 : r2 instead of CASE WHEN t1 THEN r1 ELSE r2 END.

[ ] t ? x : xx
[x] (t ? true : false/null) ? r1 : r2)t ? r1 : r2 dotnet#34175
[x] (t ? false/null : true) ? r1 : r2)!t ? r1 : r2 dotnet#34175
[ ] t ? true : falset == true
[ ] t ? false : true!boolExpr
[ ] !boolExpr ? x : yboolExpr ? y : x
[ ] !(t ? x : y)t ? !x : !y

WIP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions