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: converting data returned

Re: converting data returned

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Mon, 11 Jun 2007 14:29:11 -0500
Message-ID: <466d964f$0$16380$88260bb3@free.teranews.com>


sunadmn wrote:
> Afternoon all,
>
>
> I am trying to figure out how to some data manipulation that is
> straight SQL and not native to SQL*Plus. I have data that returns like
> this in a query:
>
> PERIOD RESPONSE COUNT
> 00 36.83333333333333333333333333333333333333 12
> 01 42.16666666666666666666666666666666666667 12
> 02 40.08333333333333333333333333333333333333 12
> 03 54.83333333333333333333333333333333333333 12
> 04 55.66666666666666666666666666666666666667 12
>
> Now from the above I would like to just drop everything after the
> second spot behind the decimal point but I am not sure how to do it
> inside SQL. If I were coding this in Perl I would just use a regex or
> something to manipulate the data the way I would like, but I am stuck
> using the BIRT framework of Eclipse and it really only understands
> straight SQL. Any pointers you could provide would be greqat.
>
> Thanks a million,
> -Steve
>

Another alternative....

SQL> select trunc(9999.999999,2) from dual;

TRUNC(9999.999999,2)


              9999.99

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown

-- 
Posted via a free Usenet account from http://www.teranews.com
Received on Mon Jun 11 2007 - 14:29:11 CDT

Original text of this message

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