CaseWhenExpression
Case-when expression, represents a SQL case-when clause.
There are two kind of case-when clauses in SQL, one is simple case-when clause, which has an operand following the case
keyword, for example:
case operand when a then 1 when b then 2 else 3
The other is searched case-when clause, which doesn't have an operand, for example:
case when a = 1 then 1 when b = 2 then 2 else 3
See the SQL BNF Grammar https://ronsavage.github.io/SQL/sql-2003-2.bnf.html#case%20expression
Since
3.6.0
Constructors
Properties
the result in case no when clauses are matched.
Extra properties of this expression, maybe useful in SqlFormatter to generate some special SQLs.
Check if this expression is a leaf node in expression trees.
the case operand, might be null for simple case-when clauses.
pairs of when clauses and their results.
Functions
Wrap this instance as a ColumnDeclaringExpression.
And operator, translated to the and
keyword in SQL.
Order this column or expression in ascending order.
Convert this instance to a ScalarExpression.
Between operator, translated to between .. and ..
in SQL.
Cast the current column or expression to the given SqlType.
Order this column or expression in descending order, corresponding to the desc
keyword in SQL.
Divide operator, translated to /
in SQL.
Equal operator, translated to =
in SQL.
Greater operator, translated to >
in SQL.
Greater-eq operator, translated to >=
in SQL.
Greater operator, translated to >
in SQL.
Greater-eq operator, translated to >=
in SQL.
In-list operator, translated to the in
keyword in SQL.
Check if the current column or expression is not null, translated to is not null
in SQL.
Check if the current column or expression is null, translated to is null
in SQL.
Less operator, translated to <
in SQL.
Less-eq operator, translated to <=
in SQL.
Like operator, translated to the like
keyword in SQL.
Less operator, translated to <
in SQL.
Less-eq operator, translated to <=
in SQL.
Minus operator, translated to -
in SQL.
Not-equal operator, translated to <>
in SQL.
Negative operator, translated to the not
keyword in SQL.
Not-between operator, translated to not between .. and ..
in SQL.
Not-equal operator, translated to <>
in SQL.
Not-in-list operator, translated to the not in
keyword in SQL.
Not like operator, translated to the not like
keyword in SQL.
Or operator, translated to the or
keyword in SQL.
Plus operator, translated to +
in SQL.
Mod operator, translated to %
in SQL.
Multiply operator, translated to *
in SQL.
Cast the current column or expression's type to Double.
Cast the current column or expression's type to Float.
Cast the current column or expression's type to Int.
Cast the current column or expression's type to Long.
Cast the current column or expression's type to Short.
Unary minus operator, translated to -
in SQL.
Unary plus operator, translated to +
in SQL.
Wrap the given argument as an ArgumentExpression using the sqlType.
Xor operator, translated to the xor
keyword in SQL.