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_arcor.de>
Date: Thu, 21 Jul 2005 10:35:18 +0200
Message-ID: <42df5f48$0$21249$9b4e6d93@newsread2.arcor-online.net>


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:

select decode(sign(a-b),1,0,0,1,-1,1) from dual;

You can build similar construct also with least,greatest and some other functions.

Best regards

Maxim Received on Thu Jul 21 2005 - 03:35:18 CDT

Original text of this message

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