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

Home -> Community -> Usenet -> c.d.o.server -> Re: need to narrow down value

Re: need to narrow down value

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Fri, 24 Feb 2006 14:18:13 +0100
Message-ID: <43ff0861$0$507$9b4e6d93@newsread4.arcor-online.net>


MSWEENEY schrieb:

> Maxim Demenko wrote:
> 

>>MSWEENEY schrieb:
>>
>>>I have a query where a function calculates a percentage. Now I just
>>>want to get the answer rounded to the nearest 10ths.
>>>
>>>Example:
>>>
>>>sum(c.pp_hours/b.hours*100)||'%' as Percent_pp
>>>
>>>result: 95.7446808510638297
>>>
>>>I tried the following:
>>>
>>>sum(c.pp_hours/b.hours*100, 1, 5)||'%' as Percent_pp
>>>
>>>and got the error: ORA-00909: invalid number of arguments
>>>
>>>How do I round this off to the tenths?
>>>
>>>Thanks for all of the help!!!
>>>
>>
>>http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions135.htm#i78633
>>might be helpful.
>>Also, argument of SUM() may be an expression, but not the list.
>>Best regards
>>
>>Maxim
> 
> 
> I'm unable to go to the sight above due to constraints on my computer
> system.  I'm not sure what you mean when you say that a SUM is an
> expression and not a list.
> 

For provided example this should work:
round(sum(c.pp_hours/b.hours*100),10)||'%' as Percent_pp where 10 stands for number of decimal places right of the decimal point. However, i wonder, how can one work with Oracle without having access to   Oracle documentation.

Best regards

Maxim Received on Fri Feb 24 2006 - 07:18:13 CST

Original text of this message

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