You can use case
expression:
select last_name
, case when commision_pct is null then 'No Commission' else commision_pct end
from employees;
or coalesce
:
select last_name
, coalesce(commision_pct, 'No Commission')
from employees;
or nvl
:
select last_name
, nvl(commision_pct, 'No Commission')
from employees;
P.S. In case commision_pct
's datatype is not varchar
you should also use cast
or to_char
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…