Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Decode Statement
On 10 Oct 2001 12:01:44 -0700, dennishancy_at_eaton.com (Dennis Hancy)
wrote:
>A typical Decode statement looks like this..
>
>decode(value, if1, then1, if2, then2...)
>
>
>Can the "if" values be replaced with a range? For instance, what if
>you wanted to check if "value" is between 1 and 10.
>
>Could you do this...
>
>decode(value, between 1 and 10, then1, if2, then2...) ?
For A between B and C:
DECODE( SIGN(a-b),
1, DECODE( SIGN(a - c), -1, TRUE, FALSE ), FALSE)Received on Wed Oct 10 2001 - 14:36:13 CDT