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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: simple sql problem

RE: simple sql problem

From: Amar Kumar Padhi <TS2017_at_emirates.com>
Date: Tue, 31 Jul 2001 01:47:03 -0700
Message-ID: <F001.00359B36.20010731014551@fatcity.com>

<SPAN
class=964364008-31072001>or,
set
numformat '999999990.99' (in sql*plus)
<SPAN
class=964364008-31072001> 

  <FONT face="Times New Roman"
  size=2>-----Original Message-----From: Swapna_Chinnagangannagari   [mailto:Swapna_Chinnagangannagari_at_satyam.com]Sent: Tuesday, July   31, 2001 12:26 PMTo: Multiple recipients of list   ORACLE-LSubject: RE: simple sql problem   Hello Raja,
  You can try this way   

  1)select x+y sum1 from
  blah
  2)col sum1 format 09.99   

  3)select x+y sum1 from
  blah
  rgds <FONT
  face=Arial color=#800000 size=2>swapna   

    -----Original Message----- <FONT
    face=Arial size=1>From:   Viraj
    Luthra [SMTP:viraj999_at_lycos.com] <FONT face=Arial     size=1>Sent:   Tuesday, July
    31, 2001 12:31 PM <FONT face=Arial

    size=1>To:     <FONT face=Arial 
    size=1>Multiple recipients of list ORACLE-L <FONT face=Arial 
    size=1>Subject:        <FONT 
    face=Arial size=1>RE: simple sql problem 
     No, I mean, if (x+y) < 1, that is a     value of .92 which it prints out, but I want it to print out like, 0.92,     that is a "0." is concatenateed to the result.     therefore, when i have,
    select x+y from blah
    I should get 90 when the value is really     90 and I should get 0.92 when the value     is really .92
    Any comments
    rgds,
    raja --     

    On Mon, 30 Jul 2001 22:00:23 
     Amar Kumar Padhi wrote:
>I believe what you meant is if it is less
    than one then the output should be <FONT face=Arial     size=2>>1. >if so: <FONT
    face=Arial size=2>> >select (case
    when x + y > 1 then x + Y <FONT face=Arial     size=2>>            
    else  1 <FONT face=Arial
    size=2>>        end) from blah;
> <FONT face=Arial

    size=2>> >-----Original
    Message----- >Sent: Tuesday, July 31,     2001 9:10 AM >To: Multiple recipients     of list ORACLE-L > <FONT
    face=Arial size=2>> >Hello
    all, > <FONT face=Arial
    size=2>>If I have a situation, where I have the following:-
> <FONT face=Arial

    size=2>>select x+y from blah <FONT face=Arial     size=2>> >and if x+y > 1, eg 5
    then the output can be 5, >but if x+y     < 1, eg, .92, then I need the output as 0.92. <FONT face=Arial     size=2>> >How do I do this?
> <FONT face=Arial

    size=2>>rgds, > <FONT
    face=Arial size=2>>raja >
> >Get

    250 color business cards for FREE! ><A     target=_blank
    href="http://businesscards.lycos.com/vp/fastpath/">http://businesscards.lycos.com/vp/fastpath/
>-- <FONT face=Arial

    size=2>>Please see the official ORACLE-L FAQ: <A target=_blank 
    href="http://www.orafaq.com">http://www.orafaq.com <FONT 
    face=Arial size=2>>-- >Author: 

    Viraj Luthra >  INET:
    viraj999_at_lycos.com > <FONT
    face=Arial size=2>>Fat City Network Services    -- (858)     538-5051  FAX: (858) 538-5051 <FONT face=Arial     size=2>>San Diego, California        Received on Tue Jul 31 2001 - 03:47:03 CDT

Original text of this message

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