Archives of the TeradataForum
Message Posted: Thu, 18 Oct 2001 @ 10:39:58 GMT
<-- Anonymously Posted: Thursday, October 18, 2001 05:33 -->
We regularly use CASE statements in our code as they are excellent in that only one pass of a table is required to satisfy a query.
However, has anyone any views on how these case statements should be constructed? For example:
CASE WHEN COL1 = 'A' THEN 'ANSWER A' WHEN COL1 = 'B' THEN 'ANSWER B' WHEN COL1 = 'C' THEN 'ANSWER C' WHEN COL1 = 'D' THEN 'ANSWER D' ELSE 'OTHER' END
Are there likely to be performance differences when most of the values in COL1 are 'A' versus when most of the values in COL1 are 'D'?
Your comments would be appreciated.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|