Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 06 Apr 2004 @ 17:59:00 GMT


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


Subj:   Aggregating a derived table
 
From:   rablum

I have a query that attempts to aggregate fields from a derived table. The derived table runs in 5 minutes, with approx 100,000 records, but the aggregation runs out of spool space. I need tocount/sum a distinct set of records, hence the derived table.

How can I improve the query so it doesn't run out of spool space?

It looks something like this:

     select count (t1.col1), sum (t1.col2), t1.col3
     from
     (Select Distinct col1, col2, col3, col4, col5
     from table1) t1
     Group by t1.col3


     
  <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: 27 Dec 2016