where isnull(性别,'') <> '女'

解决方案 »

  1.   

    where rtrim(isnull(性别,'')) <> '女'
      

  2.   

    用了上面两个大师推荐的 没反应跟用<>效果一样不起作用
      

  3.   

    declare @s int
    set @s=1
    create table t(isd int)
    insert into t
     select 1
     union
     select 2
     union
     select  3
     
    select * from t where isd<>@s
    select * from t
    drop table t
      

  4.   

    是一致的阿 我用的是sql7.0 我是说单独执行你那句sql语句的时候是没有问题的
    但放到存储过程里就不行了
      

  5.   

    where rtrim(isnull(性别,''))!= '女'
      

  6.   

    where not( ltrim(rtrim(isnull(性别,''))) = '女')
      

  7.   

    1.可能是你數據本身就有問題,
    例如:可能你的數據類型為char(5), 則其值實為'女   ',(注意后面的空格)
    用 where  ltrim(rtrim(isnull(性别,''))) <> '女' 肯定是可以的.2.可能是where not( ltrim(rtrim(isnull(性别,''))) = '女')寫成了
    where ltrim(rtrim(isnull(性别,''))) <> '女  '(注意后面不要有空格)
      

  8.   

    我左右空格都去了 都没有用 照你这么说可能是我的sql7。0有问题了
      

  9.   

    try:where rtrim(isnull(性别,'')) <> N'女'