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: ">" in select-Statement

Re: ">" in select-Statement

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Thu, 21 Jul 2005 22:24:36 +0200
Message-ID: <dbp09v$lq8$04$1@news.t-online.com>


Rene Nyffenegger wrote:
> On 2005-07-21, stupsnose <swetter_at_arcor.de> wrote:
>

>>stupsnose schrieb:
>>
>>>Maxim Demenko schrieb:
>>>
>>>
>>>>stupsnose schrieb:
>>>>
>>>>
>>>>>Hello!
>>>>>
>>>>>I wonder if i can use something like
>>>>>SELECT DECODE(a>b,0,1) FROM dual;
>>>>>to check if a is greater then b? Can someone help me please?
>>>>>
>>>>>Thank you!
>>>>>Stefan
>>>>
>>>>
>>>>
>>>>The simpliest approach would be to code that with a CASE - you can 
>>>>directly compare the values. If you must use decode however, it could be:
>>>>
>>>>Best regards
>>>>
>>>>Maxim
>>>
>>>
>>>Thank you. I don't know how to use CASE in an SELECT-Statement. Can you 
>>>give me an example? Thanks!
>>>
>>>Stefan
>>
>>I found an example. Thank you. I use Oracle8i,  think CASE is not 
>>implemented there, is it?

>
>
> 8i's SQL knows case when..end.
>
> But not within PL/SQL.
>
> 9i onwards does have it in PL/SQL also.
>
> hth
> Rene
>

Although, there was a workaround to do CASE within PL/SQL by using 'EXECUTE IMMEDIATE'. Of course, only *workaround*.

Best regards

Maxim Received on Thu Jul 21 2005 - 15:24:36 CDT

Original text of this message

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