sql通常都是查列非空的,有没办法查行非空的?谢谢

解决方案 »

  1.   

    --1
    where col is not null
    --2
    where col !=''
    --3
    where col is not null and col !-''
      

  2.   

    col1 is not null and col2 is not null and col3 is not null
      

  3.   

    3貌似应该是where col is not null and col !=''
      

  4.   

    行非空呀
    where cast(col as sql_variant)
    +cast(co2 as sql_variant)
    +cast(co3 as sql_variant)
    is not null
    这样??
      

  5.   

    select * from tb where col1 is not null and col2 is not null .....
      

  6.   

    set ansi_null offselect * from tb where col1 <> null and col2 <> null .....set ansi_null onselect * from tb where col1 is not null and col2 is not null .....
      

  7.   

    --自身左连接 ,查询 is null记录。select a.* from tb a left join tb b on a.[col1]=b.[col1] where b.[col1] is null