Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: to_char, to_number, or none?

Re: to_char, to_number, or none?

From: Philippe <parnaud_at_yahoo.com>
Date: Fri, 5 Feb 1999 11:55:38 +0100
Message-ID: <79eitq$i5l$1@concorde.ctp.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US