All Forums UDA
depakjan 11 posts Joined 01/09
02 Mar 2009
Using relational operators for CHAR

i wanna know how the reltional functions works out with CHAR EGSEL CASE WHEN '00t' > '003' THEN 1 ELSE 0 END returns 0 andSEL CASE WHEN '00t' > '030' THEN 1 ELSE 0 END returns 1why???

depakjan 11 posts Joined 01/09
09 Mar 2009

*bump*.....Man!!!! no one knows this????

09 Mar 2009

What exactly are you trying to find out?Which character had greater binary value?? or which is the succeeding number in storage?Can you rephrase?

Ramakrishna Vedantam, Tata consultancy services, Hyderabad

CarlosAL 512 posts Joined 04/08
09 Mar 2009

This is not true (at least not in my system):SEL CASE WHEN '00t' > '003' THEN 1 ELSE 0 END;SEL CASE WHEN '00t' > '003' THEN 1 ELSE 0 END; *** Query completed. One row found. One column returned. *** Total elapsed time was 1 second. ------------------ 1 BTEQ -- Enter your DBC/SQL request or BTEQ command:SEL CASE WHEN '00t' > '030' THEN 1 ELSE 0 END;SEL CASE WHEN '00t' > '030' THEN 1 ELSE 0 END; *** Query completed. One row found. One column returned. *** Total elapsed time was 1 second. ------------------ 0Look for ASCII table for the answer...Cheers.Carlos.

09 Mar 2009

Even I got the same result as Carlos.Deepak. Across products the ACSII table will remain the same.http://www.asciitable.com/

Ramakrishna Vedantam, Tata consultancy services, Hyderabad

You must sign in to leave a comment.