![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 11 Oct 2005 @ 19:20:23 GMT
Howard, I don't have a DB here now, but off the top of my head I think you need to do the grouping on the large table column, rather than the small one, for it to take effect. So, if the qeury you provided:
sel
t1.small_table_code
,t1.small_table_description
,sum(t2.large_table_measure)
from small_table t1
,large_table t2
where
t1.small_table_pi=t2.large_table_column
group by 1,2;
Is equivalent to:
sel
t2.large_table_column
,t1.small_table_description
,sum(t2.large_table_measure)
from small_table t1
,large_table t2
where
t1.small_table_code=t2.large_table_column
group by 1,2;
You might see a different explain. Hope this helps :) Mirjam
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||