|
|
Archives of the TeradataForum
Message Posted: Wed, 21 Feb 2007 @ 21:28:55 GMT
Subj: | | Re: Avoid the Product Join |
|
From: | | Christie, Jon |
A term is something like x = y. You'll find them in the WHERE clause, ON clauses and sometimes, as in your query, in CASE expressions in the
select list.
Here's an example of adding a BIND term to your query:
select sum (case when b.range = 1 then 1 else 0 end)
,sum (case when b.range = 2 then 1 else 0 end)
,sum (case when b.range = 3 then 1 else 0 end)
from table_a as a
,table_b as b
where a.duration between b.min_duration and b.max_duration
and a.x = b.x; /*<---- Added BIND term. */
| |