Hi,
I am facing a problem with a select statement
I am doing a join on three tables and my query is as follows
Select
Date,Pressure
from
SystemName SN,
WellName WN,
DailyTB DT
where
SN.SID = WN.SID and
WN.ID = DT.ID and
DT.Date between '2000-06-01' and '2000-07-01'
if i use the above query it takes about 5 minutes to return the results.
But if i change the where clause to
DT.Date between '2000-06-01' and '2000-08-01'
it works fine and gets the result in 10 seconds.
If i select some other dates then the range has to be more than 3 months .
Can anyone please explain to me the reason why the query is behaving like this or am i missing something here.
I would appreciate any help regarding this problem
Thanks in advance
sudhir
I am facing a problem with a select statement
I am doing a join on three tables and my query is as follows
Select
Date,Pressure
from
SystemName SN,
WellName WN,
DailyTB DT
where
SN.SID = WN.SID and
WN.ID = DT.ID and
DT.Date between '2000-06-01' and '2000-07-01'
if i use the above query it takes about 5 minutes to return the results.
But if i change the where clause to
DT.Date between '2000-06-01' and '2000-08-01'
it works fine and gets the result in 10 seconds.
If i select some other dates then the range has to be more than 3 months .
Can anyone please explain to me the reason why the query is behaving like this or am i missing something here.
I would appreciate any help regarding this problem
Thanks in advance
sudhir