Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 21 Feb 2007 @ 21:23:08 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Avoid the Product Join
 
From:   Kael B Stratton

Emanuel,

In addition to what Jon pointed out, I think I see another problem you may be running into.

The 'between b.min_duration and b.max_duration' seems like it would cause an explosion of rows. Think about what value b.min_duration and b.max_duration might be at any given time in the select. It's possible that this could work ok, depending what column(s) you join a and b on, maybe.

I'm trying to look head any see the goal of this query. So, I'll throw out that maybe a macro might be something to think about in this case.

In any event, pausing and looking at the data helps me understand where to go. Do some grouping by in both tables. This might help in deciding what to join on. Breaking up the query into smaller queries or idea's helps, and most times when you take this approach, you all of a sudden have the answer.

I will end by saying this problem almost seems like a quiz question.


Good luck,

Kael



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023