有三个条件
1 部门为007
2 编号不为null
3 编号不为空
如何select?
大家帮忙。

解决方案 »

  1.   

    select * from 表 where 部门='007'  and 编号 is not null and 编号<>''
      

  2.   

    select
    *
    from tb
    where
    部门='007'
    and 编号 is not null 
    and 编号<>''
      

  3.   


    select * from 表 where rtrim(部门)='007'  and 编号 is not null and 编号 <>''
      

  4.   

    select
    *
    from tb
    where
    部门='007'
    and  isnull(编号,'')<>''
      

  5.   

    --来晚了
    select
    *
    from tb
    where
    部门='007'
    and 编号 is not null 
    and 编号<>''
      

  6.   

    select * from 表 where 部门='007'  and 编号 is not null and 编号 <>''
    就是这个
      

  7.   

    select * from 表 where 部门='007'  and 编号 is not null and 编号 <>'' 
      

  8.   

    select * from 表 where 部门='007' and 编号 is not null and 编号<>''
      

  9.   


    select * from 表 where rtrim(部门)='007'  and 编号 is not null and 编号 <>''
      

  10.   

    不要用<>,会影响效率,直接用isnull(编号,'')>''即可select * from 表 where rtrim(部门)='007'  and isnull(编号,'') > ''