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: IIF IN ORACLE

Re: IIF IN ORACLE

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 8 May 2006 13:39:39 -0800
Message-ID: <445fac8b$1@news.victoria.tc.ca>


Mark D Powell (Mark.Powell_at_eds.com) wrote:
: Besides Volker's reference to the CASE statement there is also the
: older DECODE function.

It may not be clear how this is useful if you wish things like

        IF A between 1 and 10...

for the OP, the usual trick is to use SIGN and some simple arithmetic

	decode( sign(a-1),
		-1 , return_value_when_a_less_than_1 ,
		decode( sign(a-10),
			1 , return_value_when_a_more_than_10
			return_value_when_a_between_1_and_10
		      )
	      )

$0.10 Received on Mon May 08 2006 - 16:39:39 CDT

Original text of this message

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