CASE Branching : CASE « Function « SQL / MySQL






CASE Branching

      

CASE expr
WHEN val1 THEN result1
WHEN val2 THEN result2
...
ELSE resultn
END

   
    
    
    
    
    
  








Related examples in the same category

1.CASE() Function
2.The next version of the CASE() function
3.CASE is a variant of IF that is useful when all the branch decisions depend on the value of a single expression.
4.Using case in select statement
5.Use both case expressions shown previously in a SELECT statement.
6.Using the comparison value form of CASE...WHEN
7.Using CASE...WHEN for evaluating conditions
8.Variants of CASE.WHEN with no ELSE clause
9.Use a CASE...WHEN function to indicate that the different categories have different sales trends
10.Case without else clause
11.Nested case statement
12.Case with comparison
13.Case when with and operator
14.Provide more meaningful value with case clause
15.Make more complete value with case statement
16.Using case statement to check a range
17.Use case else to check the exceptions
18.Using case with comparison
19.Case clause and aggregate function
20.If ELSE is omitted, the null value is returned.