select * from v_wms_base_location lo
          left join v_wms_base_zone zo on (lo.zone_id=zo.id)
          left join v_wms_item_location_map ma on (ma.loc_id=lo.id)
          left join v_wms_inv_detail de on (lo.id=de.loc_id)
          where UPPER(lo.LOC_CODE) LIKE '%' || UPPER('s') || '%' and ma.id is null 
          and (de.qty=0 or de.qty is null)这什么问题?  到ORACLE上运行没问题啊

解决方案 »

  1.   

    MSSQL里可以like ‘%’吗?我还真没这么用过。
      

  2.   

    like % 是不是就不是空?有值?
      

  3.   

    这是ORACLE          有值的
      

  4.   

    <select id="SelectForNull"  parameterClass="System.Collections.IDictionary">
          <![CDATA[
              select * from v_wms_base_location lo
              left join v_wms_base_zone zo on (lo.zone_id=zo.id)
              left join v_wms_item_location_map ma on (ma.loc_id=lo.id)
              left join v_wms_inv_detail de on (lo.id=de.loc_id)
              where UPPER(lo.LOC_CODE) LIKE '%' || UPPER(#LOC_CODE#) || '%' and ma.id is null 
              and (de.qty=0 or de.qty is null)]]>
        </select>      这是ibatis代码
      

  5.   

    UPPER(lo.LOC_CODE) LIKE '%' || UPPER(#LOC_CODE#) || '%'
    这个条件没看明白
      

  6.   

    ||在Oracle中好像是连接用的吧,sql server 和oracle是有点区别的,不能完全一样用的,虽然大体上没什么区别,但如关键字、格式还有是点区别的,如top在oracle中是不能用的
      

  7.   

    where UPPER(lo.LOC_CODE) LIKE '%' + UPPER(#LOC_CODE#) + '%' and ma.id is null  
      

  8.   

    ||在sqlserver里没有此用法,请百度查询一下sqlserver与oracle的一些常用区别