Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: to_char, to_number, or none?
SELECT DEPT_ID "Dept", UPPER(LAST_NAME)||' '||FIRST_NAME "Employee Name"
, SALARY, salary*12 , DECODE(COMMISSION_PCT*.01, NULL,
'n/a',TO_CHAR(COMMISSION_PCT*.01)) "Commission"
FROM S_EMP, S_DEPT, S_REGION
WHERE S_DEPT.ID IN (44, 45, 50)
AND S_EMP.DEPT_ID = S_DEPT.ID
AND S_REGION.ID = S_DEPT.REGION_ID
ORDER BY DEPT_ID;
HTH
Philippe
>
>--This does not work, I try to_char, to_number and did not have any
>success. I need to display the 'n/a', but the fiels datatype is
>NUMBER(4.2). Please help if you can.
>SELECT DEPT_ID "Dept", UPPER(LAST_NAME)||' '||FIRST_NAME "Employee Name"
>
>, SALARY, salary*12 , NVL(COMMISSION_PCT*.01, 'n/a') "Commission"
>FROM S_EMP, S_DEPT, S_REGION
>WHERE S_DEPT.ID IN (44, 45, 50)
>AND S_EMP.DEPT_ID = S_DEPT.ID
>AND S_REGION.ID = S_DEPT.REGION_ID
>ORDER BY DEPT_ID;
>
>Sebastian Santos <sebas_at_shaw.wave.ca>
>
Received on Fri Feb 05 1999 - 04:55:38 CST
![]() |
![]() |