Detailed description of case expressions in Ruby and rubycase expressions
There are two forms of Ruby case expressions:
The first form is similar to a set of continuous if statements: it allows you to list a set of conditions and execute the first statement corresponding to the true condition expression.
In the second form, specify a target at the top of the case statement, and each when clause lists one or more comparison conditions.
Like if, case returns the value of the last expression to be executed. if the expression and condition are in the same row, the then keyword can be used to differentiate them.
In the Select Case X statement of a multi-branch statement, if the value of X is less than 10, what expression should be input after the Case condition?
Case Is <10
Briefly describe the usage of the CASE expression in SQL
Select
(Case when
To_char (sysdate, 'day ')
= 'Friday' then 10000
When
To_char (sysdate, 'day ')
= 'Saturday' then 8000
Else
5000
End) as Money
From dual
----------------------------------