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 -> *DECODE* to implement IF condition???

*DECODE* to implement IF condition???

From: Vamshi <yrg01_at_yahoo.com>
Date: 30 Oct 2001 22:16:17 -0800
Message-ID: <b97132c2.0110302216.5b4ab808@posting.google.com>


HI All,
I have a conditional display situation as below:

if T1.Col4 = 'ABC'

{ 	if ( (T1.date1 < sysadate) && (T1.date2 > sysdate) ) 
  	{ DISPLAY 'ABC YES';

}
else { DISPLAY 'ABC NO';
}

}
else if T1.Col4 = 'DEF'
{ 	if ( (T1.date1 < sysadate) && (T1.date2 > sysdate) ) 
  	{ DISPLAY 'DEF YES';

}
else { DISPLAY 'DEF NO';
}

}
else
{ DISPLAY "NEITHER ABC NOR DEF"
}

Can this condition be implemented in a select statement with DECODE... that looks like



Select decode(.....some smart logic.....) from table T1

Any clues on how to approach this?

Thanks folks!

Cheers,
Vamshi Reddy Received on Wed Oct 31 2001 - 00:16:17 CST

Original text of this message

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