Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 17 Mar 2003 @ 23:19:46 GMT


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


Subj:   SQL Subquery issue
 
From:   Ganga Palakattil

I have an issue with a Subquery. If I replace the SubQuery with hard-coded values, the response is 5 seconds. But with the SubQuery in place, it takes several minutes.

SELECT  SubGroupID
          QuestionID
          QuarterID
          QuestionID,
          AnswerID,
          sum(WeightNo)
  from  DatabaseName.FA_Customer
 where  QuarterID <= (select max(quarterid) from
DatabaseName.lu_quarter)
   and  QuarterID >= (select (max(quarterid)-3) from tabs.lu_quarter_vw)
   and  QuestionID = 440
   and  SubGroupID = 2

Any idea what is going on here?


Thanks

Ganga Palakattil



     
  <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