Q: Cast function in Teradata to convert character to number decode(BITAND(Col,1),1,'D','')|| decode(BITAND(Col,2),2,'d','')|| decode(BITAND(Col,4),4,'B','')|| decode(BITAND(Col,8),8,'b','')|| 

How i can Cast the above condition in teradata.
Thanks in advance!!

A: I don't believe there is a 1:1 DECODE() equivalent in Teradata. You will probably need to use a CASE statement instead:
CASE WHEN BITAND(col,1)=1 THEN 'D' END || CASE WHEN BITAND(col,2)=2 THEN 'd' END || CASE WHEN BITAND(Col,4)=4 THEN 'B' END || CASE WHEN BITAND(Col,8)=8 THEN 'b' END

