All Forums Database
kkreddy427 2 posts Joined 10/10
14 Jan 2015
DECODE uneven behavior

My session in Teradata mode. But decode by default behaving like a case specific.

any solution to avoid this.

 

SELECT CASE WHEN 'y' = 'y' THEN 'yes' ELSE 'no' END output

Result:

yes

SELECT CASE WHEN 'y' = 'Y' THEN 'yes' ELSE 'no' END output

Result:

yes

 

SELECT DECODE ('y','y','yes','no') output

Result:

yes

SELECT DECODE ('y','Y','yes','no') output

Result:

no

 

KKReddy
dnoeth 4628 posts Joined 11/04
14 Jan 2015

Hi KKReddy,
I never used DECODE (in Teradata), but it's probably casespecific to mimic Oracle's result.

Dieter

kkreddy427 2 posts Joined 10/10
21 Jan 2015

Thanks Dieter.
 

KKReddy

You must sign in to leave a comment.