I met a situation where I need to compare the lower case alphabets with upper case. But in teradata lower and upper functions are unable to do that.
here is the example:
sel case when upper('AbC')=lower('AbC') then 1 else 0 end as flag, upper('AbC'),lower('AbC');
When I am comparing the string using lower and upper() function , TD is treating them equal and when I am printing them , Alphabets are being chaged.
Please helpme on this..!
Thanks in advance...
By default Teradata is not case sensitive, so it will treat Abc = ABC, While in you statement you are explicitly converting one string to upper and one string to lower, you should cast them to the same case, In order to perform case sensitive comparison you can add CASESENSTIVE in fron of string like below:
sel case when upper('AbC') (CASESPECIFIC) = lower('AbC') (CASESPECIFIC) then 1 else 0 end as flag, upper('AbC'),lower('AbC');