DECODE uneven behavior

Database

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

2 REPLIES
Senior Apprentice

Re: DECODE uneven behavior

Hi KKReddy,

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

Re: DECODE uneven behavior

Thanks Dieter.