"<>" in the where clause will not induce index.
If trade_date is always less than Sysdate and an index is available on trade_date column, then use LESS THAN "<" and remove truncate function.
select * from test
where trade_date = (select max(trade_date)
from test
where trade_date < sysdate);




Reply With Quote