![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 21 Feb 2007 @ 18:29:08 GMT
Hi all.... I need your help to try to avoid a Product Join in this 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;
The tables:
table_a (duration is not part of the index)
table_b (primary index: range, min_duration, max_duration)
Any ideas? Thanks Castelli, Emanuel Alejandro
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||