Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Query Select
 

Using Searched CASE Expressions

Searched CASE expressions use conditions to determine the returned value and have the following syntax: CASE   WHEN condition1 THEN result1   WHEN condition2 THEN result2   ...   WHEN conditionN THEN resultN   ELSE default_result END where condition1, condition2, ..., conditionN are the expressions to be evaluated. result1, result2, ..., resultN are the returned results (one for each possible condition). If condition1 is true, result1 is returned, and so on. default_result is the default result returned when no true condition is found.