Of Interest
Business Intelligence and Analytics
Oracle Training
|
Oracle
»
PL-SQL
»
Case
»
Case Statement
This is one of the more popular functions available in PL-SQL, for situations too complex for DECODE.
Example:
select
case when bonus < 10000 then bonus*1.3 else bonus * 1.2 end as super_bonus
from employee;
In this example, the "super_bonus" is the bonus plus 30%, if the bonus is presently < 10,000, otherwise it is the bonus plus 20%.
|
|
|
Get the latest Rocket99 news and tech tips via
|