Case inside case

Database
N/A

Case inside case

Does teradata allow to use cascading case statements.

Like

sum
(
case when exp1 then
Case when exp2 then
End
Else
End

If yes will there be a performance issue? Each cascade condition actually has a join on a different table (ie records qualifying in exp1 of case1 from table1 will be checked in exp2 of case2 which will again join with table2) .

say exp1 would be a.col1=b.col1 when this satisfied
exp2 would be b.col2=c.col1

If there would be a performance issue with this approach let me know if there is a better way to get this done.
2 REPLIES
N/A

Re: Case inside case

It's done by using AND clause with multiple WHEN(condition) in same CASE statement instead of cascade.

Re: Case inside case