我还原了一下 并没有发现你说的内种情况 。。两个都可以查出来 。。可以把建表语句插入语句和你写的 sql发一下吗 。
create table A
(
B VARCHAR2(32)
);
insert into a(b) values ('20170526')
select * from a where b = '20170526' or b < to_char(add_months(to_date('20170526','yyyy-MM-dd'),-5),'yyyyMMdd');
select * from a where b = '20170526' or to_date(b,'yyyyMMdd') < add_months(to_date('20170526','yyyy-MM-dd'),-5);