Archives of the TeradataForum
Message Posted: Sat, 05 Sep 2009 @ 16:21:55 GMT
Subj: | | Re: Using a case Statement in a where clause |
|
From: | | Fred W Pluebell |
Teradata 13.0 permits "scalar subquery" so you could use syntax closer to what's in your post. Otherwise, you need to move the subquery to the
FROM clause as a derived table expression, for example:
Select L.* from Loan L
CROSS JOIN
(select day_of_week from sys_calendar.calendar
Where calendar_date = current_date) D
Where L.Application_Date between
case when D.day_of_week <> 2 then current_date - 1 else current_date - 3
end
And current_date -1;
|