各位大侠:
在oracle中执行如下语句时,oracle提示“无效的月分”
delete 系统_参数_表 xtcs
  where xtcs.参数名称 like '%财政月'
    and (xtcs.采暖期,xtcs.参数名称) not in (
      select distinct 
          to_char(add_months(to_date((case when substr(yhjf1.凭证号,1,2)>='50' then '19' else '20' end)||substr(yhjf1.凭证号,1,4),'yyyymm'),-4),'yyyy') 凭证采暖期
          ,yhjf1.凭证号系统标识||'财政月'
        from 费用_交费_表 yhjf1
        where yhjf1.凭证号系统标识 is not null);
但在oracle中单独执行子查询语句时,oracle可以正常执行,并返回正确结果
select distinct 
    to_char(add_months(to_date((case when substr(yhjf1.凭证号,1,2)>='50' then '19' else '20' end)||substr(yhjf1.凭证号,1,4),'yyyymm'),-4),'yyyy') 凭证采暖期
    ,yhjf1.凭证号系统标识||'财政月'
  from 费用_交费_表 yhjf1
  where yhjf1.凭证号系统标识 is not null;
我检查了数据,在费用_交费_表.凭证号(3,4位)中有非法的月分值,但可以通过“yhjf1.凭证号系统标识 is not null”完全过滤掉。请教为什么单独执行子查询可以而含在delete中执行却报错,我该怎么写这条语句,多谢!