Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Decode doubt
On Fri, 27 Aug 1999 22:33:37 GMT, Prakash <venkatprakash_at_my-deja.com>
wrote:
To get 100 if A > 0 ,otherwise null you could use:
DECODE(SIGN(A),1,100,null)
To get <somevalue> if A > <someothervalue> otherwise <yetanothervalue> you could use:
DECODE(SIGN(A - <someothervalue>),1,<somevalue>,<yetanothervalue>)
etc.
>Hi
>
>Could anyone tell me whats is the equvilant of IIF in Oracle? Means:
>
>I want to do this:
>
>IIF (A > 0, 100)
>
>Our decode just compares with the ' = ' it doen't do the > or <
>operations. I could only write decode(a, 0, 100) I want to write
>decode(a, > 0, 100) or something like this
>
>Can anybody give me a clue on this?
>
>Thanks
>
>V Prakash
>venkatprakash_at_hotmail.com
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Fri Aug 27 1999 - 21:15:09 CDT
![]() |
![]() |