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 -> to_char, to_number, or none?

to_char, to_number, or none?

From: Sebas Santos <sebas_at_shaw.wave.ca>
Date: Fri, 05 Feb 1999 06:06:08 GMT
Message-ID: <36BA8A93.62E7E6A6@shaw.wave.ca>


--This works fine, inserts zeros when the Commission is Null
SELECT DEPT_ID "Dept", UPPER(LAST_NAME)||' '||FIRST_NAME "Employee Name"

, SALARY, salary*12 , NVL(COMMISSION_PCT*.01, 0) "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;
--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 - 00:06:08 CST

Original text of this message

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