Archives of the TeradataForum
Message Posted: Mon, 17 Mar 2003 @ 23:19:46 GMT
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
|