SQL - Single Function03
SQL - Single Function03
Case
Decode
select last_name,job_id, salary, case job_id when 'IT_PROG' then salary+salary*.10
when 'SA_REP' then salary+salary*.15
when 'PU_CLERK'
then salary+salary*.20
else salary
end as INCREMENTED_SALARY
from employees
select last_name,salary, case when salary between 15000 and 25000 then 'A'
when salary between 10000 and 14999 then 'B'
when salary between 5000
and 9999 then 'C'
when salary between 0 and
4999 then 'D'
else 'E'
end as grade
from employees
CONVERSION FUNCTIONS
select to_number('2,341.25','9,999.99')+to_number('22,452.35','999,999.99')
from dual
9 - any digit
, - thousand indicator
. - deciaml
0 - forces a zero
L - local currency
$ - Dollor symbol
select to_date('11-Jan-24') -to_date('10-Dec-22') from dual
to_char
from employees