Archives of the TeradataForum
Message Posted: Tue, 14 Sep 1999 @ 17:06:54 GMT
| Subj: || || Re: Question with CASE |
| From: || || Fred Pluebell |
A character constant is by default _Unicode VARCHAR. The character data type of a CASE statement is defined to be the type of the first
THEN clause. You can avoid the TRANSLATE by explicitly declaring the constant _LATIN '1' or rearranging the expression.
Given the stated cardinality of Spool3, Product Join may actually perform well. If not, you could try simplifying the join condition
using a derived table:
SELECT * FROM
(SELECT CASE WHEN Table1.COD_ROLE IS NULL
OR Table1.COD_LIEU_DISP = _Latin '0'
THEN _Latin '1'
LEFT JOIN Table2
ON Table2.COD_ROLE = Derived1.COD_ROLE