where 里写 is not null 过滤掉不就的了?

解决方案 »

  1.   

    Where tCwZtInforCode = InZtCode and tCwZtInforCode is not null and InZtCode is not null;
      

  2.   

    那样不行,我必须这样做,而且必须让这一步成功!因为5个字段中有存在不为空的,我必须把不为空的给查出来。
    也就是说,我要把5个字段中不为空的查出来并ASSIGN 到变量中。有没有其他思路?
      

  3.   

    Select nvl(tCwZtInforTable1, ' '),
          nvl(tCwZtInforTable2, ' '), 
          nvl(tCwZtInforTable3,  ' '), 
          nvl(tCwZtInforTable4, ' ')
          nvl(tCwZtInforTable5, ' ')
      into sTbl1,sTbl2,sTbl3,sTbl4,sTbl5 
      From tCwZtInfor 
      Where tCwZtInforCode = InZtCode 
      and (tCwZtInforTable1 is not null
    or tCwZtInforTable2 is not null
    or tCwZtInforTable3 is not null 
    or tCwZtInforTable4 is not null
    or tCwZtInforTable5 is not null
      )
      

  4.   

    Where nvl(tCwZtInforCode,1) =nvl(InZtCode,1)