This query takes about 10 to 11 seconds to run, is there something I can do differently to make it run a little faster? Please note the hard coded dates will be changed to a variable. Right now I am just testing.
Thanks
Thanks
Code:
select * from nyl_sfp_balances nsb2
where nsb2.pool not in
(select nsr.pool
from nyl_sfp_balances nsr
where hist_date = '2007-01-31') or
nsb2.loan not in
(select nsr.loan
from nyl_sfp_balances nsr
where hist_date = '2007-01-31')
and
nsb2.hist_date=
(select max(hist_date) from nyl_sfp_balances where hist_date < '2007-01-31')