Case inside case
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Case inside case Expand / Collapse
Author
Message
Posted 6/23/2008 3:49:05 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/28/2008 3:52:19 PM
Posts: 81, Visits: 94
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.


Regards,
Sakthi

Do your duty Dont expect the reward, God will give the benefit for you

Post #11946
Posted 6/25/2008 12:30:16 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/28/2008 3:52:19 PM
Posts: 81, Visits: 94
It's done by using AND clause with multiple WHEN(condition) in same CASE statement instead of cascade.

Regards,
Sakthi

Do your duty Dont expect the reward, God will give the benefit for you

Post #11953
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 ( 1 guest, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 4:18pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 7 queries. Compression Disabled.